1.HashMap不同步,HashTable同步。
2.HashTabel不允许有null值(key和value)都不允许。HashMap允许null值(key和value都可以)。
3.两者的遍历方式大同小异,HashTable积极比HashMap多一个elements方法。
4.HashTable使用Enumeration,hashmap使用Iterator。
5.哈希值不同,HashTable直接使用对象的hashCode,HashMap重新计算hash值,而且用于代替求模。
j7.HashMap基于AbstractMap类,HashTable基于Dictionary类。