集合排序问题

1.集合中含有字符串排序----->须将字符串字段转为Integer类型排序

2.方式一:集合排序  集合.sort(Comparator.comparing(集合中的对象::getCancelFansCount)) 

倒序:Collections.reverse(list);

方式二:

集合= 集合.stream().sorted(Comparator.comparing(集合中的对象::getVersionTime)
.reversed()).collect(Collectors.toList());

posted @ 2019-03-21 10:43  卡卡学习  阅读(134)  评论(0编辑  收藏  举报