Collections 自定义比较器 Comparator
Comparator comparator = new PriSort (); Collections.sort(list, comparator);import java.util.Comparator;public class PriSort implements Comparator<ProcessInfo> { @Override public int compare(ProcessInfo p1, ProcessInfo p2) {//对象参数
原创
2020-08-29 15:59:57 ·
177 阅读 ·
0 评论