Like Us On Facebook

Follow Us On Twitter

Drop Down Menu

Showing posts with label Java Collections. Show all posts
Showing posts with label Java Collections. Show all posts

Friday, 10 March 2017

Difference Between Hashmap and Hashtable Java

There are several notable differences between Hashmap and Hashtable in Java, such as:

1. Hashmap has one sub-type -> LinkedHashMap. It is used if you want insertion order by default, in which case you can easily swap a Hashmap for a LinkedHashMap, which wouldn't be possible in case of a Hashtable.
2. Hashmap allows a single NULL key and any number of NULL values, whereas Hashtable does not allow NULL KEYS OR VALUES.