I\'m creating an educational game for young students who needs to learn the most common words. On random I pick three words of the list, show them on the screen, play an audio r
First get the entry set from the map:
Set> entries = map.entrySet();
Now dump that into an ArrayList so you can sort it:
List> sortedEntries = new ArrayList<>(entries);
Now sort the list:
Collections.sort(sortedEntries, /*Define your comparitor here to compare by values */);
Your list now has the contents of the map sorted by value, you can access them in whatever order you like.