I learned how to use the comparable but I\'m having difficulty with the Comparator. I am having a error in my code:
Exception in thread \"main\" java.lang.C
For the sake of completeness, here's a simple one-liner compare method:
compare
Collections.sort(people, new Comparator() { @Override public int compare(Person lhs, Person rhs) { return Integer.signum(lhs.getId() - rhs.getId()); } });