Hashtable, Hashmap, and TreeMap are the most common map implementations, which are container types that store and manipulate data in the form of key-value pairs.
Hashtable is a hash implementation provided by the Java class Library that is inherently synchronous, does not support null keys and null values, and is rarely recommended because of the performance overhead associated with synchronization.
HashMap is the application of a more extensive hash table implementation, the behavior is roughly consistent with Hashtable, the main difference is that HashMap is not synchronous, support null keys and null values and so on. Typically, the HashMap performs a get and put operation to achieve constant time performance, so it is the most preferred choice for accessing the scene using key values.
TreeMap is based on a red-black tree to provide sequential access to the map, its get, put, remove and other operations are the time complexity of O (Logn), the specific order can be determined by the specified comparator, or according to the natural order of the keys to judge.
What is the difference between Java vs. Hashtable, Hashmap, TreeMap? (Studying in progress)