HashMap is a lightweight implementation of Hashtable (not thread-safe implementations), and they all complete the map interface, with the main difference being that hashmap allows null (NULL) key values (key), which may be more efficient than hashtable due to non thread-safe.
HashMap allows NULL to be used as a entry key or value, and Hashtable is not allowed.
HashMap the Hashtable contains method removed, changed to Containsvalue and ContainsKey. Because the contains method is easy to cause misunderstanding.
Hashtable inherits from the dictionary class, and HashMap is an implementation of the map interface introduced by Java1.2.
The biggest difference is that the Hashtable method is synchronize, and HashMap is not, when multiple threads access Hashtable, they do not need to synchronize their methods, and HashMap must provide an external synchronization.
Hashtable and HashMap adopt the Hash/rehash algorithm are probably the same, so there is no significant difference in performance.