Is the order of HashMap elements reproducible?
问题 First of all, I want to make it clear that I would never use a HashMap to do things that require some kind of order in the data structure and that this question is motivated by my curiosity about the inner details of Java HashMap implementation. You can read in the java documentation on Object about the Object method hashCode . I understand from there that hashCode implementation for classes such as String and basic types wrappers ( Integer , Long ,...) is predictable once the value contained