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
What is data type example?
State one difference between a template class and class template.
Which method cannot be overridden in java?
What is numeric function?
Are floats faster than doubles?
What is a java list?
How finally used under exception handling?
What is difference between pointer and reference?
What is assembly used for?
What is :: operator in java?
What is the independent variable in an experiment?
what is the swingutilities.invokelater(runnable) method for? : Java thread
What is array list in java?
What is a nested structure?
How do you sort data in java?