码迷,mamicode.com
首页 > 其他好文 > 详细

获取List集合中最大值的方法

时间:2017-04-24 19:03:03      阅读:968      评论:0      收藏:0      [点我收藏+]

标签:最大   ons   new   获取   add   style   集合   list   code   

     List ll = new ArrayList();
        ll.add(new BigDecimal(1));
        ll.add(new BigDecimal(4.99));
        ll.add(new BigDecimal(5));
        System.out.println("最大值: " + Collections.max(ll));
        System.out.println("最小值: " + Collections.min(ll));

 

获取List集合中最大值的方法

标签:最大   ons   new   获取   add   style   集合   list   code   

原文地址:http://www.cnblogs.com/mr-wuxiansheng/p/6758217.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!