初始化:

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;
}
});

posted on 2019-11-12 14:34  韩坨麟  阅读(233)  评论(0编辑  收藏  举报