Skip to content

Tag Archives: Java-Vector

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
As we all know an array is a group of liked-typed variables that are referred to by a common name while on the other hand… 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
The forEach() method of Vector is used to perform a given action for every element of the Iterable of Vector until all elements have been… Read More
The clone() method of the Vector class is used to return a shallow copy of this vector provided by the Object class. It just creates… Read More
1. toArray() The toArray() method of Vector class in Java is used to form an array of the same elements as that of the Vector.… Read More
remove(int index) The java.util.vector.remove(int index) method is used to remove an element from a Vector from a specific position or index. Syntax: Vector.remove(int index) Parameters:… Read More
The java.util.vector.contains() method is used to check whether a specific element is present in the Vector or not. So basically it is used to check… Read More
The java.util.vector.copyInto() method is used to copy all of the components from this vector to another array, having enough space to hold all of the… Read More
The java.util.vector.get() method is used to fetch or retrieve an element at a specific index from a Vector. Syntax: Vector.get(int index) Parameters: This method accepts… Read More
The java.util.vector.indexOf(Object element) method is used to check and find the occurrence of a particular element in the vector. If the element is present then… Read More
The java.util.vector.elementAt(int pos) method is used to fetch or retrieve an element at a specific index from a Vector. Syntax: Vector.elementAt(int pos) Parameters: This method… Read More
The java.util.vector.elements() method of Vector class in Java is used to get the enumeration of the values present in the Vector. Syntax: Enumeration enu =… Read More
The java.util.vector.equals(Object obj) method of Vector class in Java is used verify the equality of an Object with a vector and compare them. The list… Read More

Start Your Coding Journey Now!