- http://java.sun.com/docs/books/tutorial/collections/interfaces/order.html
- Sample code
List e = new ArrayList(employees);
Collections.sort(e, new Comparator
() {
public int compare(Employee e1, Employee e2) {
return e2.getFirstName().compareTo(e1.getFirstName());
}
}
);
No comments:
Post a Comment