Loading
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
VulpesRank #55 · 29.2K reputationPosted Mar 24, 2014, 5:45 AM EDT
In the case of the HashMap class, there is no guarantee that this will be the case - the order in which the elements are returned by an iteration will not necessarily be the same as the order in which they were added.
Abhijeet SinghRank #415 · 6K reputationPosted Mar 28, 2014, 9:52 AM EDT
Please Explain with example?
VulpesRank #55 · 29.2K reputationPosted Mar 28, 2014, 5:12 PM EDT
The output is:
Notice that in the case of LinkedHashMap, the entries are iterated in the order they were added but this is not so in the case of HashMap.