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 main difference between variable and constant?

538


What are the five major types of reference sources?

543


State differences between C and Java?

669


Is java a software?

520


How do you do exponents in java?

551






What is thread pool in java with example?

549


What are the concepts of 'OOPS'?

607


How many bits is a float?

548


What is a generic code?

532


Explain where variables are created in memory?

588


What are the four corner stones of oop?

553


What is meant by main method?

587


What does you mean in math?

544


How do I remove a character from a string in java?

511


what is the significance of listiterator in java?

628