hashmap与hashtable最大的不同在于前者是线程不安全的,而后者是线程安全的。 问题是我们为什么要让一个线程不安全的代替线程安全的呢? 他们第二个不同在于前者key和value都可以插入null,而后者不行。这个是书面上说的。
While the Hashtable was part of the initial Java release over two decades ago, the HashMap is the correct key-value store to use today. One key HashMap vs. Hashtable difference is the fact that the ...