2 Answers
2

The order depends on the result of the hashCode() function in the keys you are inserting which, unless you did something strange, is going to be mostly random (but consistent). What you are looking for is a sorted map such as a LinkedHashMap

Check out a little bit about how hashtables work here if you are interested in the details.