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
What are checked exceptions?
Explain numeric promotion?
What is Major and importance difference between for and foreach loop ?
What is a generic data type?
What is a class reference?
Why is the main method declared static?
What are the methods available in a class?
Why Java is not pure Object Oriented language?
Can a class be declared as static?
How do you sing an Applet ?
Can we have more than one package statement in source file ?
Does java return by reference?
How is java created?
Does a function need a return?
What is supplier in java?