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
Define iterator and methods in iterator?
How is a structure different from array ?
What is == and === in javascript?
Can we use catch statement for checked exceptions when there is no chance of raising exception in our code?
what is mutual exclusion? How can you take care of mutual exclusion using java threads? : Java thread
How do you find the absolute value?
What is the difference between JVM and JRE?
What does system out println () do?
What do heavy weight components mean in java programming?
How do you sort a list in java?
How many types of methods are there?
What does s mean in regex?
Which containers use a flowlayout as their default layout in java programming?
How do you sort objects in java?
What is indexof?