标签:comment ble 接口 span obj compare rabl bsp word
<1>对List<T>排序:
T 实现comparable接口,重写 compareTo 方法
调用collections.sort(list);
<2>使用比较器Comparator
Collections.sort(studentArr, new Comparator<Object>() {
public int compare(Object o1, Object o2) {
Student s1 = (Student) o1;
Student s2 = (Student) o2;
if(){reutrn 1};
else if(){return -1};
return 0;
}
});
标签:comment ble 接口 span obj compare rabl bsp word
原文地址:http://www.cnblogs.com/meisp/p/6645332.html