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
How many functional interfaces does java 8 have?
Is a string literal?
In the below example, how many string objects are created?
Is java good for beginners?
What are the default and parameterized constructors?
What is java objectoutputstream?
How do you sort arraylist in descending order?
Is arraylist dynamic in java?
Which is the best sorting technique in java?
What do you understand by classes in java?
Explain about narrowing conversion in java?
why we use merge option in hybernate pls give a ex snippet
Which class cannot be a subclass in java?
What are the main concepts of oops in java?
How do you sing an Applet ?