List<Pair<Integer,Integer>>使用lambda排序


List>list=new ArrayList<>();
Collections.sort(list,(a,b)->a.getKey()-b.getKey());
//labmbda表达式,按first从小到大排序

 

你可能感兴趣的:(JAVA,每日总结,leetcode,list,数据结构)