返回顶部

java中给集合快速取值最大值和最小值

 public static void main(String[] args) {
  List list  = new ArrayList();
   list.add(new Double(123.23));
   list.add(new Double(33.23));
   list.add(new Double(13.23));
   list.add(new Double(3.23));
   System.out.println(getMaxDouble(list));
 }
 public static double getMaxDouble(List list){

     double max = Collections.max(list);
     double min = Collections.min(list);
      return max;
 }

https://blog.csdn.net/li1246994520/article/details/50834100/

posted @ 2020-01-14 23:24  fen斗  阅读(8168)  评论(0编辑  收藏  举报