what is the difference between HashMap and Hashtable

Answer Posted / chandan phukan

Two main differences between Hastable and HashMap are

1. Hashtable is synchronised but HashMap is not.
2. Hashtable does not allow "null" key but HashMap allows
"null" Key.

However one point to remember is that only one "null" key is
allowed in HashMap but multiple "null" values are allowed in
HashMap.

Is This Answer Correct ?    75 Yes 9 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is object cloning in Java?

625


List down the methods and interfaces of collection class in java.

533


What is the default value of an object reference declared as an instance variable?

527


Explain the transient field modifier?

556


why java does not support unsigned keyword?

4233






How can you share data between two thread in Java?

516


what is meant wrapper classes?

594


What is args length in java?

648


What do you mean by ordered and sorted in collections in java?

542


Name few java util classes introduced with java 8 ?

491


How do you check whether the list is empty or not in java?

505


Which package is imported by default?

621


What is a parameter in java?

537


What is a default constructor and also define copy contrucyor?

591


What is a variable analysis?

628