Create Vector objects
Vector()
- Creates an empty vector so that its internal data array has size 10 and its standard capacity increment is zero.
Vector(Collection<? extends E> c)
- Creates a vector containing the elements of the specified collection, in the order they are returned by the collection's iterator.
Vector(int initialCapacity)
- Creates an empty vector with the specified initial capacity and with its capacity increment equal to zero.
Vector(int initialCapacity, int capacityIncrement)
- Creates an empty vector with the specified initial capacity and capacity increment.
import java.util.Vector;
public class Main{
public static void main(String args[]) {
Vector v = new Vector(2000);
System.out.println(v.capacity());
}
}
The output:
2000
Home
Java Book
Collection
Java Book
Collection
Vector:
- Vector class
- Create Vector objects
- Add elements to this vector
- Size and capacity
- Remove all elements from a vector
- Clone a vector
- Does it contain a certain element
- Copy elements in vector to an array
- Get Enumeration from this vector
- Compare two vectors
- Get element from vector
- Is vector empty
- Get element index
- Remove element from a vector
- Retain elements collection c has
- Replace element in a vector
- Get a sub list from a list
- Convert Vector to Array