List || Lists

初始化:

List<int> list = Lists.newArrayList();

初始化一个SIZE为1的列表

List<int> list = Lists.newArrayList(1);

初始化:

List<int> list = Arrays.asList();

初始化,并且将元素 1 放入列表中

List<int> list = Arrays.asList(1);

、、、、、、、、、、List 中按照对象指定元素倒序排列、、、、、、、、、、、、、、、、、、、、、、、

Collections.sort(respList, new Comparator<CoreOrdInfo>() {
@Override
public int compare(CoreOrdInfo o1, CoreOrdInfo o2) {
int def = new BigDecimal(o2.getValidateDate().replace("-", "")).compareTo(new BigDecimal(o1.getValidateDate().replace("-", "")));
if(def > 0) {
return 1;
}else if(def < 0){
return -1;
}
return 0;
}
});

原文地址:https://www.cnblogs.com/hanwuxing/p/11841726.html