A. List Interface collection:
1, advantages and characteristics: orderly, allow repeating elements.
2. Implementation class:
* Aarraylist class: Asynchronous, variable-length array, multiplication rate is 1/n;
* LinkedList class: Not synchronized, linked list structure, adding and deleting fast.
* Vector Class (the elder, not currently used): synchronous, variable length, multiplied by 1 time times.
Second, set interface set:
1, advantages and Features: unordered collection, do not allow repeating elements.
2. Implementation class:
* HashSet class: No synchronization, hash table, unordered, based on the hash value of the deposit element, in addition, can be based on a number of fields to establish their own unique hash value code, the replication Equals method;
* TreeSet class: Out-of-sync, tree-like structure, can be the natural sort of objects;
For example: Judging the sorting order compares the hash value of age and name, int temp = This.age-p.age; return temp = 0? This.name.CompareTo (p.name): temp;
Note: The study is shallow, the unknown place please understand!
Author: Rick-bao
Java-Collection Frame Finishing