集合使用Stream流倒叙生成新的集合

50 阅读1分钟

List sort =anList.stream() .sorted(Comparator.comparing(Province::getIndex) .reversed()) .collect(Collectors.toList());