You are viewing a single comment's thread. Return to all comments →
One liner because writing understandable code is less fun.
class Checker implements Comparator<Player>{ public int compare(Player p1, Player p2){ return p1.score != p2.score ? p2.score -p1.score : p1.name.compareToIgnoreCase(p2.name) > 0 ? 1 : -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 →
One liner because writing understandable code is less fun.