what is the difference between HashMap and Hashtable

Answer Posted / arun rajesh

The HashMap class is roughly equivalent to Hashtable,
except that it is unsynchronized and permits nulls.
(HashMap allows null values as key and value whereas
Hashtable doesnt allow).

HashMap does not guarantee that the order of the map will
remain constant over time. HashMap is unsynchronized and
Hashtable is synchronized.

Is This Answer Correct ?    54 Yes 12 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Difference between stack and queue?

816


What is type safety in java?

732


What is difference between throw and throws ?

868


Is java good for beginners?

763


how to create constants in java?

839


What is hashmap in java?

822


Can we write a class without main method in java?

698


How do you print array in java?

747


Explain the difference between call by refrence and call by value?

793


Why string is not a wrapper class?

907


What is the difference amongst jvm spec, jvm implementation, jvm runtime ?

733


What is nested loop? What is dangling else condition in it?

824


What class allows you to read objects directly from a stream in java programming?

769


What are methods of a class?

764


What is the static keyword?

816