There are a total of two interfaces: Collection and Map, a collection of elements, and a set of key-value pairs, where the list and set interfaces inherit the Collection interface, one is an ordered set of elements, and the other is a set of unordered elements, while ArrayList and LinkedList The implementation of the list interface, HashSet implementation of the set interface, which are more commonly used, HASHMAP and hashtable implementation of the map interface, and Hashtable is thread-safe, but HashMap performance is better;
Note: All collections (List, set, and map) implement Cloneable (prototype mode) and Serializable (serialization)
java.util.Collection [I]
|-java.util.list [I]
|-java.util.arraylist [C]
|-java.util.linkedlist [C]
|-java.util.vector [C]
|-JAVA.UTIL.STACK[C]
|-java.util.set [I]
|-java.util.hashset [C]
|-java.util.sortedset [I]
|-java.util.treeset [C]
Java.util.Map [I]
|-java.util.sortedmap [I]
|-java.util.treemap [C]
|-java.util.hashtable [C]
|-java.util.hashmap [C]
|-java.util.linkedhashmap [C]
|-java.util.weakhashmap [C]
The most basic interfaces in the Java Collection class are:
Collection: Root interface for single-column collections
List: Elements are ordered and repeatable
ArrayList: Similar to a variable-length array. Suitable for inquiries, not suitable additions and deletions
LinkedList: The bottom is a two-way loop linked list. Suitable for additions and deletions, not suitable for inquiries.
Set: Element unordered, non-repeatable
HashSet: Determines the position of an element in the collection based on the hash value of the object
TreeSet: Storing elements in a two-tree way, enabling ordering of elements in the collection
Map: The root interface of a double-column collection that stores elements that have a key (key), value-mapping relationship.
HashMap: Used to store a key-value mapping relationship, cannot appear duplicate key
TreeMap: Used to store key-value mappings, cannot appear duplicate key key, all keys are arranged in binary tree way
What are the basic interfaces of the Java Collection Class framework?