Aman Mohd wrote:Well i know that... i guess i cudnt explain wat i needed... i need to sort the hashmap key attributes.
You could do this: (1) put all the keys of the HashMap in a List, (2) sort the list however you like.
As Rob says, a HashMap is unordered - there is no way that you can put the keys into the HashMap itself in a particular order. Think of a HashMap as a bag with key-value pairs which are not in any particular order.