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 scope & storage allocation of static, local and register variables? Explain with an example.

570


Explain access modifiers in java.

586


How objects of a class are created if no constructor is defined in the class?

582


What is an empty class? What functionality does it offer in Java?

679


How do you ensure that n threads can access n resources without deadlock?

816






Where to store local variables?

587


Is minecraft 1.15 out?

551


How can you write a loop indefinitely in java programming?

556


how does the run() method in runnable work? : Java thread

516


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

506


Java is pass by value or pass by reference? Explain

536


Is .net better than java?

557


How long will it take to learn java?

511


What is nullpointerexception?

560


Is string serializable in java?

547