java 排序

class HumanComparetor implements Comparator<WorkContentInfoBO> {
@Override
public int compare(WorkContentInfoBO h1, WorkContentInfoBO h2) {

//倒序
return h2.getAdd_time().compareTo(h1.getAdd_time());
}
}
Collections.sort(list, new HumanComparetor());

上一篇:A1006


下一篇:java-减少H2上的线程争用