HashTable

1
2
3
4
5
public class Hashtable<K,V>
extends Dictionary<K,V>
implements Map<K,V>, Cloneable, java.io.Serializable {

}

HashTable继承于Dictionary类,字典类是一个抽象类,而且已经被废弃了

1
2
//NOTE: This class is obsolete.  New implementations should
//implement the Map interface, rather than extending this class.

对于Hashtable使用场景也很少,因为JDK中有一个和他类似的类,HashMap。

Hashtable和Hashmap的区别:

1
(The {@code HashMap}class is roughly equivalent to {@code Hashtable}, except that it is unsynchronized and permits nulls.) 

HashTable比HashMap多了同步,少了对null的支持,,所以我们可以直接移步到HashMap。