1.Hashtable原型如下:繼承的是Dictionary類,實(shí)現(xiàn)了Map接口
public class Hashtable<K,V>extends Dictionary<K,V>implements Map<K,V>, Cloneable, Serializable

HashMap原型如下:實(shí)現(xiàn)了Map接口:
public class HashMap<K,V>
extends AbstractMap<K,V>implements Map<K,V>, Cloneable, Serializable
2.Hashtable是線程同步的,HashMap在默認(rèn)情況下是非線程同步的
3.Hashtable不允許key和value為null,而HashMap允許。
4.由于底層的實(shí)現(xiàn)機(jī)制不同,HashMap的速度快于Hashtable,因?yàn)镠ashMap不需要同步檢查,建議在非多線程環(huán)境中使用HashMap代替Hashtable。