對List集合中的對象進行按某個屬性排序

謹以此文獻給天上星 一 、通過code自然排序 resultList.sort((h1, h2) -> h1.getCode().compareTo(h2.getCode())); 二 、通過code反序排列 Comparator<ProomRealTimeOut> comparator = (h1, h2) -> h1.getCode().compareTo(h2.getCode()); res
相關文章
相關標籤/搜索