1、HashMap 不是线程安全的,HashTable是线程安全的。
2、HashMap 允许空(null)的键和值(key),Hashtable则不允许。
Map
a、Map是一个以键值对存储的接口。Map下有两个具体实现,分别是HashMap和HashTable。
b、HashMap 不是线程安全的,HashTable是线程安全的。所以HashMap的效率要高于HashTable。
1、HashMap 不是线程安全的,HashTable是线程安全的。
2、HashMap 允许空(null)的键和值(key),Hashtable则不允许。
Map
a、Map是一个以键值对存储的接口。Map下有两个具体实现,分别是HashMap和HashTable。
b、HashMap 不是线程安全的,HashTable是线程安全的。所以HashMap的效率要高于HashTable。