I have a problem while using the HashMap, the requirement is to retrieve the keys in the order I put them, I know that HashMap does not guarantee me the order, but it is been used in too many places in my project, hence it is a scary change to use a different collection, does anyone know any workaround to get over this??? please help ASAP
There is no way to know the order of insertion in a regular HashMap. As Jim suggested, change your code to use a LinkedHashMap instead (or if you're ambitious create your own mechanism to track insertions in some way).
Thanx a lot ppl, actually I have already started with the linked hash map. I just wanted to know if there is any other easy work around, anyways thanx for all you ppl's hlp.
Thanks tiny ad, for helping me escape the terrible comfort of this chair.
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth