Skip to content

Tag Archives: Java-Vector

Using LinkedHashSet and TreeSet, duplicate elements are removed. Because the LinkedHashSet and TreeSet do not accept duplicate elements.  Example: Input : vector = [1, 2,… Read More
Vector is a class that implements the List interface. It is a type of dynamic array that means the size of a vector can be… Read More
Vector is a legacy class in Java and is present from Java 1.2 version. It implements the List interface of the Collection framework and is… Read More
Prerequisite: Vectors in Java Why We Use Vector? Till now, we have learned two ways for declaring either with a fixed size of array or… Read More
Data structure is a way of storing and organising data efficiently such that the required operations on them can be performed efficiently with respect to… Read More
The retainAll method of class vector in java is an inbuilt function in Java which is used to retains only the elements in this Vector… Read More
java.util.Vector.listIterator() This method returns a list iterator over the elements of a Vector object in proper sequence. It is bidirectional, so both forward and backward… Read More
iterator() method of Vector class that is present inside java.util package is used to return an iterator of the same elements as that of the… Read More
The java.util.Vector.removeElement() method is used to remove first occurrence of particular object. If object is not found then it returns false else it returns true.… Read More
The Java.util.Vector.setSize() is a method of Vector class that is used to set the new size of the vector. If the new size of the… Read More
The Java.util.Vector.removeAllElements() method is used to removes all components from this Vector and sets its size to zero. Syntax: Vector.removeAllElements() Parameters: The method does not… Read More
The setElementAt() method of Java Vector is used to set the component at the specified index of this vector to be the specified object. The… Read More
The java.util.Vector.toString() is an inbuilt method of Vector that is used to get a string representation of the objects of Vector in the form of… Read More
The removeRange() method of Vector in Java is used to remove all elements within the specified range from an Vector object. It shifts any succeeding… Read More
The ensureCapacity() method of Java.util.Vector class increases the capacity of this Vector instance, if necessary, to ensure that it can hold at least the number… Read More

Start Your Coding Journey Now!