Differences between HashMap and Hashtable?
问题 What are the differences between a HashMap and a Hashtable in Java? Which is more efficient for non-threaded applications? 回答1: There are several differences between HashMap and Hashtable in Java: Hashtable is synchronized, whereas HashMap is not. This makes HashMap better for non-threaded applications, as unsynchronized Objects typically perform better than synchronized ones. Hashtable does not allow null keys or values. HashMap allows one null key and any number of null values. One of