Privacy Policy Terms Of Use. Copyright © 2006-2010 Java Tutorials and Examples.
Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.
1) Vector()
Creates a new empty vector with size 10 and capacityIncrement 0.
Example
Vector v = new Vector();
Creates a new Vector object with size 10.
2) Vector (int initialCapacity)
Creates a new empty vector with the specified initial capacity and with capacityIncrement equal to 0.
Example
Vector v = new Vector(100);
Creates a new Vector with initialCapacity equals to 100 and capacityIncrement equals to 0.
3) Vector (Collection c)
Creates a new vector containing elements of the specified collection in the order returned by the Collection’s Iterator.
Example
Vector v = new Vector(myCollection);
Where myCollection is the Object of type Collection.
4) Vector (int initialCapacity, int capacityIncrement)
Creates a new empty vector with the specified initial capacity and with specified capacityIncrement.
Example
Vector v = new Vector(100,20);
Creates a new Vector with initialCapacity equals to 100 and capacityIncrement equals to 20.
<< Java Vector Tutorial Java Vector Search Elements >>

Post new comment