I want to sort a Map on key and value. First on key then on value.
For example, this should be the result;
1,2
1,3
2,1
2,2
Anyone has a suggestion on how to achieve this effectively? I’ve been seeing people using a TreeMap to sort keys, however i also need values.
Or ofcouse any other method of sorting pairs on key and value is welcome.
1 Answer