Tag Archives: Java-Vector

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
The java.util.vector.size() method in Java is used to get the size of the Vector or the number of elements present in the Vector. Syntax: Vector.size()… Read More
The java.util.vector.hashCode() method in Java is used to get the hashcode value of this vector. Syntax: Vector.hashCode() Parameters: The method does not take any parameter.… Read More
The java.util.vector.insertElementAt(element, index) method is used to insert a particular element at the specified index of the Vector. Both the element and the position is… Read More
The java.util.vector.firstElement() method in Java is used to retrieve or fetch the first element of the Vector. It returns the element present at the 0th… Read More
The java.util.vector.lastElement() method in Java is used to retrieve or fetch the last element of the Vector. It returns the element present at the last… Read More
The java.util.vector.removeAll(Collection col) method is used to remove all the elements from the vector, present in the collection specified. Syntax: Vector.removeAll(Collection col) Parameters: This method… Read More