LATEST UPDATES

Friday 18 November 2016

What differences exist between HashMap and Hashtable ?


    1. HashMap allows the existence of null keys and values, 
    2. Hashtable doesn’t allow neither null keys, nor null values.

    1. Hashtable is synchronized.
    2. while a HashMap is not.

    1.  HashMap is preferred in single-threaded environments.
    2.  Hashtable is suitable for multi-threaded environments.

    1. HashMap provides its set of keys and a Java application can iterate over them.
    2. Hashtable provides an Enumeration of its keys.

No comments:

Post a Comment

Designed By Blogger Templates