You are viewing a single comment's thread. Return to all comments →
Simpler way in java.
class Checker implements Comparator<Player> { public int compare(Player a, Player b){ if(a.score>b.score) return -1; else if(a.score<b.score) return 1; else return a.name.compareTo(b.name); } }
Seems like cookies are disabled on this browser, please enable them to open this website
Sorting: Comparator
You are viewing a single comment's thread. Return to all comments →
Simpler way in java.