@w1024020103
2017-01-26T16:44:58.000000Z
字数 788
阅读 501
bittiger
java
data
structure
Comparable?
Comparator
Comparable
public class Employee implements Comparable<Employee> {
String name;
int age;
@Override
public int compareTo(Employee that) {
return
public class AgeComparator implements Comparator<Employee> {
@Override
public int compare(Employee e1, Employee e2)
return e1.getAge() - e2.getAge();
}
An anonymous function -- no name, in-line