jdk源码之 hashmap 与hashtable 的区别

  hashmap hashtable
线程安全

否,但jdk5之后,提供ConcurrentHashMap,可

替代HashTable。

是,synchronized
value是否允许为空 否,throw new NullPointerException()
迭代器 fail-fast enumerator
     

未完待续...

原文地址:https://www.cnblogs.com/fhychzu/p/6939739.html