Tag Archives: Java-Vector

Vector implements a dynamic array that means it can grow or shrink as required. Like an array, it contains components that can be accessed using… Read More
There are several ways to convert ArrayList to Vector. We can use a vector constructor for converting ArrayList to vector. We can read ArrayList elements… Read More
Vector class Implements a dynamic array means it can shrink and expand its size as required just likely having the same operations like that in… Read More
The first element in the Vector can be obtained using the firstElement() method of vector class that is represent util package. The last element in… Read More
The Vector class implements a growable array of objects. It is available in java.util package. It implements the List interface. The Enumeration interface defines the… Read More
To replace an element in Java Vector, set() method of java.util.Vector class can be used. The set() method takes two parameters-the indexes of the element… Read More
There are multiple ways to convert vector to ArrayList, using passing the Vector in ArrayList constructor and by using simple vector traversal and adding values… Read More
java.util.Collections.sort() method is present in java.util.Collections class. It is used to sort the elements present in the specified list of Collection in ascending order. Syntax:… Read More
Vectors basically fall in legacy classes but now it is fully compatible with collections. Java has many built-in functions to perform different operations on collections… Read More
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