Collections.max方法获取List集合里面最大的数,例如:
List<Integer> list = new ArrayList<>();
        list.add(1);
        list.add(22);
        list.add(333);

        // 获取最小值
        Integer min = Collections.min(list);
        // 获取最大值
        Integer max = Collections.max(list);

 

相关文章:

  • 2021-05-20
  • 2021-06-20
  • 2021-12-18
  • 2021-08-03
  • 2021-08-23
  • 2021-09-16
猜你喜欢
  • 2021-12-14
  • 2021-08-09
  • 2022-03-04
  • 2021-06-11
  • 2021-06-09
  • 2021-10-02
  • 2021-10-13
相关资源
相似解决方案