I am reading the Java Hashmap documentation but I don’t understand this sentence.
Note that the iteration order for
HashMap is non-deterministic. If you
want deterministic iteration, use
LinkedHashMap.
What does deterministic mean?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The simplest definition:
Given the same inputs, you always get the same outputs.
Above, it’s saying that iterating through the exact same HashMap may give different results at different times, even when you haven’t changed anything. Usually that doesn’t matter, but if it does, you should use a LinkedHashMap.