The HashMap used is:
public static HashMap<User,Integer> onlineUsers = new HashMap<User,Integer>();
Lets say I add values like this:
onlineUsers.put(myUserObj,1);
onlineUsers.put(myUserObj,5);
onlineUsers.put(myUserObj,2);
How can I print the values out in descending order?
5
2
1
I've seen how do to this with a TreeMap but the Key in this case cannot be an integer.