Map,hashmap,linkedhashmap,treemap,collections Class (Non-collenction interface)
1. Map
Map Overview: An object that maps keys to values. A map cannot contain duplicate keys, and each key can be mapped to at most one value. This is the key-value pair.
The difference between map and collection: Map: The element that stores the key-value pair, the keyboard is unique, and the value can be duplicated.
Collection: Stores individual elements, sub-interfaces set elements unique, sub-interfaces list elements can be duplicated.
Format:< key type, value type, such as:map<string,string> mp=new hashmap<string,string> ();
Put ();
Remove ();
Clear ();
EntrySet ();
Get ();
KeySet ();
Values ();
ContainsKey ();
Containsvalue ();
IsEmpty ();
Size ();
2, HashMap
The key is the hash table structure that guarantees the uniqueness of the key.
The difference between HashMap and Hashtable: HashMap: Thread insecure, high efficiency, allow null key, value.
Hashtable: Thread-safe, inefficient, null key, value not allowed.
3, Linkedhashmap
The hash table and link list implementations of the map interface have a predictable sequence of iterations.
4, TreeMap
The key is a red-black tree structure that guarantees the ordering and uniqueness of the keys.
5. Collections Class (Non-collenction interface)
The difference between collections and collection: Collections: A tool class for collection operations.
Collection: The top-level interface of the collection, with the list and set subinterfaces.
Sort ();
Binartsearch ();
Max ();
Min ();
Reverse ();
Shuffle ();
Older Dick Silk Self-study note--java 0 basics to rookie--030