标签:list new get ret .com 表达式 return ide public
list 排序
java 8 以前写法: Collections.sort(list, new Comparator<CompeteCollectorResponse>() { @Override public int compare(CompeteCollectorResponse o1, CompeteCollectorResponse o2) { return o1.getOrder()-o2.getOrder(); } }); java 8写法: Collections.sort(list, (CompeteCollectorResponse o1, CompeteCollectorResponse o2) -> { return o1.getOrder().compareTo(o2.getOrder()); });
标签:list new get ret .com 表达式 return ide public
原文地址:https://www.cnblogs.com/janederek/p/9376936.html