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 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));
转载于:https://www.cnblogs.com/mr-wuxiansheng/p/6758217.html