How does Java order items in a HashMap or a HashTable?

Posted by ComputerJy on Stack Overflow See other posts from Stack Overflow or by ComputerJy
Published on 2010-05-12T09:59:27Z Indexed on 2010/05/12 10:04 UTC
Read the original article Hit count: 134

Filed under:
|
|
|
|

I was wondering how Java sorts items in the Map (HashMap or Hashtable) when they are added. Are the keys sorted by the hashcode, memory reference or by allocation precedence...?

It's because I've noticed same pairs in the Map are not always sorted in the same order

© Stack Overflow or respective owner

Related posts about java

Related posts about map