You are viewing a single comment's thread. Return to all comments →
What is the meaning/difference between this syntax the the following syntax provided by some people:
class Checker { public Comparator desc = new Comparator() { public int compare(Player obj1, Player obj2) { // compare } }; }
OR even
public Comparator desc = null; public Checker() { desc = new Comparator() { public int compare(Player p1, Player p2) { //compare } }; }
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 →
What is the meaning/difference between this syntax the the following syntax provided by some people:
class Checker { public Comparator desc = new Comparator() { public int compare(Player obj1, Player obj2) { // compare } }; }
OR even
public Comparator desc = null; public Checker() { desc = new Comparator() { public int compare(Player p1, Player p2) { //compare } }; }