Hey guys! I've got a question: I have got a HashMap: Code: HashMap<String, Integer> temp = new HashMap<String, Integer>(); Now I want to sort this HashMap and send a player a List based of the Integer. So if my entries are: Code: temp.put("Tho", 2); temp.put("One", 1); temp.put("Four", 4); temp.put("Three", 3); And I want to display the Player: One -- 1 Two -- 2 Three -- 3 Four -- 4 How would I do that?
@ThrustLP My first suggestion would be a bubble sort. However I know that there are better methods to do so, somebody will come along and post them.
@ThrustLP Google is your friend. https://bukkit.org/threads/util-sorting-a-map-by-value-integer-highest-to-lowest-vice-versa.245405/
@AlvinB Hmm okay but using it I get an error at: Code: List<Entry<String, Integer>> entryList = this.tempo.entryList(); At entryList() saying The method entryList() is undefinded for the type SortedMap<String>