Tag Archives: Java-Vector

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
The Java.util.Vector.iterator() method is used to return an iterator of the same elements as that of the Vector. The elements are returned in random order… 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 which is used to set the new size of vector. If new size of vector is greater… 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 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 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 trimToSize() method of Vector in Java trims the capacity of an Vector instance to be the Vector’s current size. This method is used to… 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
Given a Vector in Java, the task is to convert this Vector to Array. Examples: Input: Vector: ['G', 'e', 'e', 'k', 's'] Output: Array: ['G',… Read More
Given a Vector, the task is to Convert Vector to List in Java Examples: Input: Vector: [1, 2, 3, 4, 5] Output: List: [1, 2,… Read More
The removeIf() method of Vector removes all of those elements from Vector which satisfies the condition passed as a parameter to this method. This method… Read More