当前位置:网站首页>List排序 ,取最大值最小值

List排序 ,取最大值最小值

2022-08-02 11:08:00 左--右

List排序 ,取最大值最小值

public static void main(String[] args) {
    
        List list = Arrays.asList(5,2,3,1,9);
        int N = list.size();
        int t = 0;
        Collections.sort(list);
        System.out.println("顺序--"+list);
        Collections.reverse(list);
        System.out.println("倒叙--"+list);
        Collections.shuffle(list);
        System.out.println("随机--"+list);

    }

Integer max = Collections.max(iList); 取中最大值
Integer max = Collections.min(iList); 取中最小值

原网站

版权声明
本文为[左--右]所创,转载请带上原文链接,感谢
https://blog.csdn.net/qq_41080067/article/details/126069445