java list根据对象的某个属性排序
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; } });
#####################
QQ 3087438119