The Java Collection Framework is a toolkit provided by Java, and in java.util.*, the package contains commonly used data structures: collections, arrays, linked lists, stacks, queues, mappings, and so on. The Java Collection framework can be divided into four parts: list lists, set sets, map mappings, and tool classes (iterator Iterators, enumeration enumeration classes, arrays, and collections).
The Java Collection framework is as follows:
As you can see, the collection framework in Java has two branches: collection and map.
1. Collection is an interface that contains the basic operations and properties of a collection. collection contains the list and set of two major branches
(1) List is an ordered queue, each element has its index, the index value of the first element is the 0,list implementation class has Arraylist,linkedlist,vector and stack.
(2) Set is a set that is not allowed to have duplicate elements. The implementation class for set has HashSet and TreeSet. HashSet relies on HashMap, which is actually implemented through HashMap; TreeSet relies on treemap, which is actually implemented by TreeMap.
2. Map is a mapped interface, which is a Key-value key-value pair. Each element in the map contains the value corresponding to a key and key.
(1) Abstractmap is an abstract class that implements most of the APIs in the map interface, and Hashmap,treemap,weakhashmap is both inherited and Abstractmap.
(2) Although Hashtable inherits from dictionary, it implements the map interface.
3. Iterator is a tool that iterates through a collection, and we typically use a iterator iterator to iterate through the collection. Collection relies on iterator because the collection implementation class implements the iterator () method and returns a iterator object. Listiterator is specifically designed to traverse the list.
4. Enumeration is an abstract class introduced by JDK1.0, as well as iterator, but it is also a traversal set, but enumeration is less powerful than iterator, and in the block diagram above, enumeration can only be used in hashtable,vector and stacks.
5. Arrays and collections are the two tool classes for the set of operand combinations, and they provide a number of useful methods.
The above is an overview of the set frame, if there are errors, please leave a message ~
Reprinted from Csdn Eson_15
Java Collection Framework 01--Overview of the overall framework