what is the difference between HashMap and Hashtable
Answer Posted / jyotsna gupta
1. Hashtable is synchronized where as hashmap is not.
2. Hashmap can contains null values as the keys and as well as values.But Hashtable dose not allow null values as keys and values.
3. 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.
4. Hashmap is faster than Hashtable.
| Is This Answer Correct ? | 2 Yes | 2 No |
Post New Answer View All Answers
Why java uses the concept of the string literal?
Lowest Common ancestor in a Binary Search Tree and Binary Tree.
What is exception hierarchy in java?
What are Normalization Rules? Define Normalization?
What is the difference between Array and Hash Table?
Explain importance of throws keyword in java?
What is jagged array in java?
What is the this keyword?
What is the difference between choice and list?
What is e java?
Explain abstract class in java?
How do you insert a line break?
Why does it take so much time to access an applet having swing components the first time?
What is substring in java?
What is thread pool? How can we create thread pool in java?