what is the difference between HashMap and Hashtable
Answer Posted / knowledge_finder
1. HashMap allows null values for key and value whereas
Hashtable doesnt allow.
2. HashMap does not guarantee that the order of the map will
remain constant over time. 3. HashMap is non synchronized
where as Hashtable is synchronized.
4. HashTable is an Old java class but Hashmap is a new java
class in java 2.
5. In HashTable you can change the iteration but in the case
of HashMap you can change the iteration but you will get a
java.util.ConcurrentModificationException.
Is This Answer Correct ? | 35 Yes | 5 No |
Post New Answer View All Answers
Can a class be declared as protected?
What is the main function in java?
What are JVM.JRE, J2EE, JNI?
Is java based on c?
Which is faster set or list in java?
What is the this keyword?
can I implement my own start() method? : Java thread
Why main function is static?
Can we declare a class as abstract without having any abstract method?
What is java developer skills?
Can you call a method on a null object?
What is covariant return type?
What do you mean by compiler?
Is age discrete or continuous?
What is the meaning of I ++ in java?