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


Please Help Members By Posting Answers For Below Questions

Can a class be declared as protected?

543


What is the main function in java?

533


What are JVM.JRE, J2EE, JNI?

697


Is java based on c?

539


Which is faster set or list in java?

534






What is the this keyword?

558


can I implement my own start() method? : Java thread

560


Why main function is static?

676


Can we declare a class as abstract without having any abstract method?

557


What is java developer skills?

519


Can you call a method on a null object?

567


What is covariant return type?

644


What do you mean by compiler?

587


Is age discrete or continuous?

692


What is the meaning of I ++ in java?

609