wuth : Wuthering Heights
mbdk : Moby Dick
wooz : Wizard of Oz
mbdk : Moby Dick
wuth : Wuthering Heights
wooz : Wizard of Oz
Keep Smiling Always — My life is smoother when running silent. -paul
[FAQs] [Certification Guides] [The Linux Documentation Project]
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
Varnam Aayiram wrote:
I am not able to understand the change in order, hope somebody can help. Thanks.
ocjp 6 — Feeding a person with food is a great thing in this world. Feeding the same person by transferring the knowledge is far more better thing. The reason is the amount of satisfaction which we get through food is of only one minute or two. But the satisfaction which we can get through the knowledge is of life long.
Mohana Rao wrote:Whenever you are accessing values from Set the order is not guarantee.(No one can't guess)
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
Martin Vajsar wrote:This is an implementation detail and nothing you should rely on. But generally, if you start with an empty HashMap and put a few items to it, the order which they'll be iterated over depends (among other things) on the capacity of the HashMap. So running the program with same set of keys, but different initial capacity and/or load factor will produce different ordering of the items when iterating.
This is just to explain the behavior you're encountering. Do not ever write code that would depend on the order in which items are kept in a HashMap or a HashSet!
Keep Smiling Always — My life is smoother when running silent. -paul
[FAQs] [Certification Guides] [The Linux Documentation Project]
Akhilesh Trivedi wrote:I knew that order is not guaranteed, but did not know initial capacity was a reason behind it.