Java Collection class relationship diagram:
List: Add/Remove/get/set.
1. arraylist: it is actually an array with a large capacity. Frequent addition or deletion is a nightmare and is suitable for random search;
2. pull list: added push/[Pop | remove | pull], which is actually removefirst;
3. Vector: A legacy product of history. The arraylist of the synchronous version is an odd and strange name,CodeIt is too similar to arraylist;
4. STACK: inherited from vector. Java does not actually have a pure stack. You can implement one by yourself. You can encapsulate the consumer list in a combination;
5. queue: Why is it here? It was originally a separate type. However, in Sun's JDK, the feature list is used to provide this function. The main method is offer/pull/PEEK.
Set: Add/Remove. What about get and set? Sorry, you can use the iterator or convert it to list.
1. hashset: It is easy to say that hashmap is used internally;
2. hashset: Same as above, implemented using linkedhashmap;
3. treeset: treemap.
Map: Put/get/remove.
1. hashmap/hashtable: the hash list. It is implemented using arrays like arraylist. exceeding the initial capacity will result in performance loss;
2. linkedhashmap: this class is somewhat interesting. It inherits from hashmap, but the chain table structure is implemented by rewriting the nested hashmap. Entry class, which also has the capacity problem;
3. properties: That's right. This is the inherited hashtable.
By the way, arrays. aslist, the implementation of this method depends on a nested class. This nested class is also called arraylist! It's too bad.