Difference between HashMap and HashTable?

Discussion in 'Programming' started by cristina.emerson, Oct 18, 2013.

  1. #1
    Hello there,

    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.

    Would you like to help me more on this ?
     
    cristina.emerson, Oct 18, 2013 IP
  2. kourang

    kourang Member

    Messages:
    59
    Likes Received:
    0
    Best Answers:
    1
    Trophy Points:
    26
    #2
    Depends upon what you want to do if your application is multithreaded then you should use HashTables if you are not using threads then you should use HashMaps...........
     
    kourang, Oct 19, 2013 IP