Vector implements a dynamic array. is an array of objects that can be automatically grown.
Comparison of vectors and ArrayList:
1, all in an array format to store data, index data block insert data slow
2, ArrayList will be faster than vector, he is non-synchronous
3, involving multi-threading, vector is a better synchronization
Usage:
1. Constructor:
1) Construction method creates a default vector with a default size of ten:vector()
2) Construction method creates a vector of the specified size: vector (int size)
3) The construction method creates a vector of the specified size, and the increment is specified with incr. Increments indicate the number of elements each increment of the vector: Vector(int size,int incr)
4) construct a vector that contains the C elements of the collection: Vector(Collection c)
2. Insert the specified element into the specified position: V.add (i,element)
3. Insert element on the last surface: V.add (Element)
4. Clear all elements: V.clear ()
5. Determine if an element is included: V.contains (Element) returns TRUE or V.indexof (element) returns subscript
6. Return the element referred to in the subscript: V.elementat (i)
7, Comparison is equal: V.equals (Element)
8. Determine if it is empty: V.isempty ()
9. Remove an element: V.remove (I | element)
10. Return Size: V.size ()
11. Set an element for a subscript store: V.set (i,element)
12. Convert to Array: V.toarray ()
13. Convert to String: v.tostring ()
Vector of JAVA data structures