Collections是一个工具类,sort是其中的静态方法,是用来对List类型进行排序的,它有两种参数形式: public static <T extends Comparable<? super T>> void sort(List<T> list) { list.sort(null); } public static <T> void sort(List<T> list, Comparator<? super T> c) {…
http://gwh-08.iteye.com/blog/1233401/ class Foo implements Comparable<Foo>{ @Override public int compareTo(ClientPortalButton o) { return this.i.compareTo(o.getI()); } }…