You are viewing a single comment's thread. Return to all comments →
public int compare(Player playerA, Player playerB) { if(playerB.score == playerA.score) { return playerA.name.compareTo(playerB.name); } else if (playerB.score > playerA.score) { return 1; } else { return -1; } }
Seems like cookies are disabled on this browser, please enable them to open this website
Java Comparator
You are viewing a single comment's thread. Return to all comments →