DEVFYI - Developer Resource - FYI

Difference between HashMap and HashTable?

Java Interview Questions and Answers (part 3)


(Continued from previous question...)

467. Difference between HashMap and HashTable?

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.

(Continued on next question...)

Other Interview Questions