慕仙森
public class TestClass { private int A; private int B; public int getA() { return A;
} public void setA(int a) {
A = a;
} public int getB() { return B;
} public void setB(int b) {
B = b;
}
public static void main(String[] args) {
List<TestClass> lists = new ArrayList<>();
Collections.sort(lists, new Comparator<TestClass>() {
@Override public int compare(TestClass o1, TestClass o2) { //自定义你的排序规则就行了
return 0;
}
});
}
}