java經過比較器對List進行排序

 Comparator<Question> comparator = new Comparator<Question>() {
                   @Override
                   public int compare(Question s1, Question s2) {
                   return s2.getTotal()-s1.getTotal();
                }
                };
                 Collections.sort(quests,comparator);ide

相關文章
相關標籤/搜索