1: Even a map interface is implemented, the underlying data structure is the same, both are transient decorated entry array, transient modified variables will not be serialized is not persisted, the process of serialization will not include this variable, The lifetime of this variable is simply not persisted to the memory disk during the user's call. This facilitates the preservation of some sensitive information
2:hashmap is insecure, cannot be synchronized, does not support multithreading concurrency, Hashtable is secure, has a synchronous lock, but is inefficient.
3:hashmap inherited from Abstractmap, Hashtable inherited from dictionary.
4:hashmap allows NULL to exist, indicating that the value of key does not exist or is null. And Hashtable cannot have null
The hash of the 5:hashtable is the hash of the object directly, and the HashMap to recalculate the hash value, thus more hashing, which helps to reduce the conflict. Increase efficiency
6:hashtable can use Itertor to implement traversal, HashMap can also use this, but in the early version Hashtable can also use enumeration to traverse
7:hashtable the size of the default initialization array is 11, you can specify the initialization size of the array, the rules for expansion are old*2+1,
HashMap The default array size is 16, the length remains a multiple of 2, and the size of the minimum 2 that is greater than initcaptiy is selected for expansion
82 supports FF failure mechanism
The similarities and differences between Java Foundation---HashMap and Hashtable