I want to know that if using an Iterator over a TreeMap in Java interfere with the order of keys?
Share
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.
From http://docs.oracle.com/javase/6/docs/api/java/util/TreeMap.html#keySet() :
If for some reason you need the keys in descending order, you can use
descendingKeySet()If you want to iterate over the values, you can use
entrySet()(Wow, I didn’t know that
Mapisn’t aCollectionbefore…)