I. Vector and ArrayList
1, synchronization: Vector is thread-safe (synchronous), and ArrayList is thread-unsafe synchronization;
2. Data growth: When growth is needed, the vector defaults to one-fold growth, while ArrayList grows by half;
Second, Collection, Set, List, LinkedList
Collection: There is no specified order between the elements objects, allowing for duplicate element objects and multiple null element objects (without the first few elements);
Set: There is no specified order between the elements objects, no duplicate element objects are allowed, and a maximum of one null element object is allowed (nor is there any argument for the first element object);
List: Each element object has a specified order, allowing for duplicate element objects and multiple null element objects, with the argument of the first few element objects, which can be sorted.
LinkedList: Implements the list interface, allows null element objects, in addition LinkedList provides additional Get,remove,insert methods at LinkedList's header or tail. These operations enable LinkedList to be used as stacks (stack), queues (queue), or bidirectional queues (deque). Note LinkedList does not have a synchronization method, and if multiple threads access a list at the same time, you must implement access synchronization yourself. One workaround is to construct a synchronized list when the list is created:
List List = Collections.synchronizedlist (new LinkedList (...));
Iii. Collection and collections
Collection: Is the interface of the java.util, it is the parent interface of various sets, inherited from his interface is mainly set and list;
Collections: Is the Java.util under the class, is for the collection of Help class, provides a series of static methods to achieve the various sets of search, sorting, thread security operations.
Iv. Collection class inheritance structure diagram
Collection
├list
│├linkedlist
│├arraylist
│└vector
│└stack
└set
Map
├hashtable
├hashmap
└weakhashmap
You can see from the structure diagram that the list and set are inherited from the collection interface, whereas the map is not.