ConcurrentHashMap pl = new ConcurrentHashMap<>();
pl.put(\"joker25\", 255);
pl.put(\"minas\", 55);
pl.put(\"agoriraso\", 122);
pl.put(\"p
Since ConcurrentHashMap makes no guarantees about ordering you'll have to dump the items into a list and then sort that. For example:
final Map pl = ....
List values = new ArrayList<>(pl.keySet());
Collections.sort(values, new Comparator() {
public int compare(String a, String b) {
// no need to worry about nulls as we know a and b are both in pl
return pl.get(a) - pl.get(b);
}
});
for(String val : values) {
System.out.println(val + "," + pl.get(val));
}