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

what is the purpose of the runtime class?

547


What is adapter in java?

506


What is string [] java?

520


What are the types of collections in java?

531


Can we override private methods?

535






What is data member in java?

493


Is char a data type in java?

533


What are the high-level thread states in java programming?

573


What is a key in java?

491


how are methods defined?

547


What is a default constructor and also define copy contrucyor?

591


What is prime number in java?

530


How many unicode characters are there?

543


What is arrays aslist in java?

506


Explain about fail fast iterators in java?

551