HashTable
1 | public class Hashtable<K,V> |
HashTable继承于Dictionary类,字典类是一个抽象类,而且已经被废弃了
1 | //NOTE: This class is obsolete. New implementations should |
对于Hashtable使用场景也很少,因为JDK中有一个和他类似的类,HashMap。
Hashtable和Hashmap的区别:
1 | (The {class is roughly equivalent to { Hashtable}, except that it is unsynchronized and permits nulls.) HashMap} |
HashTable比HashMap多了同步,少了对null的支持,,所以我们可以直接移步到HashMap。