1.

Difference Between Hashmap And Hashtable?

Answer»

There are SEVERAL differences between HashMap and Hashtable in Java:

  • Hashtable is synchronized, whereas HashMap is not.
  • Hashtable does not ALLOW null keys or values. HashMap allows one null KEY and any number of null values.
  • The third SIGNIFICANT DIFFERENCE between HashMap vs Hashtable is that Iterator in the HashMap is a fail-fast iterator while the enumerator for the Hashtable is not.

There are several differences between HashMap and Hashtable in Java:



Discussion

No Comment Found