0

I want to sort the entries in a hashmap by the value of an object's property.

Here is my HashMap:

final Map<String, Seasons> = new HashMap<>();

Here is my Seasons class:

public class Seasons {

private int results;
private int scores;
private int points;

public Seasons() {
}

//getters and setters

}

So I want to sort the hashmap in terms of each entries 'points'.

I have seen the topic that's been marked as a possible duplicate of this. I tried to use that but couldn't manage to adapt it to use it in my case.

PSLDev
  • 77
  • 6

0 Answers0