二者的區別:HashTable 是全部的方法都加鎖。code
First and most significant different between Hashtable
and HashMap
is that, HashMap
is not thread-safe while Hashtable
is a thread-safe collection.orm
Second important difference between Hashtable
and HashMap
is performance, since HashMap
is not synchronized it perform better than Hashtable
.it
Third difference on Hashtable
vs HashMap
is that Hashtable
is obsolete class and you should be using ConcurrentHashMap
in place of Hashtable
in Java.io