what is the difference between HashMap and Hashtable

Answer Posted / chandan

The key difference between the two is that access to the
Hashtable is synchronized on the table while access to the
HashMap isn't. You can add it, but it isn't there by default.

Another difference is that iterator in the HashMap is
fail-safe while the enumerator for the Hashtable isn't. If
you change the map while iterating, you'll know.

And, a third difference is that HashMap permits null values
in it, while Hashtable doesn't.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what is aggregation in java?

588


How to perform quicksort in java?

573


How do you use wildcards?

538


Is alive and join method in java?

540


What is an arraylist in java?

517






What is type parameter in java?

523


Why should I use abstract class?

573


What is difference between call by value and call by reference?

506


What are the application of stack?

505


Is java still relevant?

501


What is class variable java?

586


In how many ways we can do exception handling in java?

578


What is a memory leak in java?

549


Discuss 2D arrays.

610


How many types of array are there?

551