For the list interface, it also introduces an implementation class Vector,vector class that can be implemented to grow an array of objects. I. Vector introduction
Vectors can implement an array of objects that can grow. Like an array, it contains components that can be accessed using an integer index. However, the size of the vector can be increased or decreased to accommodate additions or deletions after the vector is created.
Vector implementation of the list interface, inherit the Abstractlist class, so we can consider it as a queue, support related additions, deletions, modifications, traversal and other functions.
Vector implements the Randmoaccess interface, which provides a random access feature that provides fast access. In vector we can access elements directly.
Vector implements the Cloneable interface, supports the Clone () method, and can be cloned.
[Java] view plain copy print? public class Vector<e> extends abstractlist<e> implements List<e>, Randomaccess, Cloneable, Java.io.Serializable
The vector provides four constructors:
[Java] View plain copy print? /** * constructs an empty vector so that its internal data array size is &NBSP;10 and its standard capacity increment is zero. */ public vector () { this (; ) } /** * constructs a vector containing the elements in the specified collection , which are based on their collection The iterator returns the order of the elements. */ public vector (collection<? &NBSP;EXTENDS&NBSP;E>&NBSP;C) { elementdata = c.toarray (); elementCount = elementdata.length; // c.toArray might (incorrectly) not return Object[] (see 6260652) if (Elementdata.getclass () != object[].class) elementdata = arrays.copyof ( elementdata, elementcount, object[].class); } /** * constructs an empty vector using the specified initial capacity and the capacity increment equal to zero. */ public vector (int initialcapacity) { this (initialcapacity, 0); } &Nbsp; /** * constructs an empty vector using the specified initial capacity and capacity increment. */ public vector (int initialcapacity, int capacityincrement) { super (); if (initialcapacity < 0) throw new illegalargumentexception ("illegal capacity: " + initialcapacity);