java list根据对象的某个属性排序
Collections.sort(list1, new Comparator<BlogRank>() { @Override public int compare(BlogRank blogRankObj1, BlogRank blogRankObj2) { if (blogRankObj1.getScore_value() > blogRankObj2.getScore_value()) { return 1; } if (blogRankObj1.getScore_value() == blogRankObj2.getScore_value()) { return 0; } return -1; } });
#####################
标签:blogRankObj2,blogRankObj1,return,getScore,list,value,java,排序 From: https://www.cnblogs.com/herd/p/16268053.html