Does anybody know how to access the elements in a hashMap with order.
I know set is a collection that doesn't gaurantee the order so the iterator of keySet will not gaurantee the order.
Is there any way to solve this?
Thanks
Printable View
Does anybody know how to access the elements in a hashMap with order.
I know set is a collection that doesn't gaurantee the order so the iterator of keySet will not gaurantee the order.
Is there any way to solve this?
Thanks
First of all, are you talking about Map or Set???
If you want a sorted Map, you can use the TreeMap class.