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/


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM