Wednesday, 18 November 2015

Difference between Hashtable and HashMap

Hashtable is synchronized. It doesn't allow null key and null values also.
HashMap is not Synchronized. It permits only one null key and any no.of values

Note:
HashMap doesn't allow duplicate keys but it allows duplicate values
Iterator in the HashMap is fail-safe while the enumerator for the Hashtable isn't.

No comments:

Post a Comment