Here you can find the source of min(List
Parameter | Description |
---|---|
numbers | the numbers to calculate the min. |
public static BigDecimal min(List<BigDecimal> numbers)
//package com.java2s; //License from project: Open Source License import java.math.BigDecimal; import java.util.List; import java.util.TreeSet; public class Main { /**/* w ww . j av a 2s .com*/ * Returns the min number in the numbers list. * * @param numbers the numbers to calculate the min. * @return the min number in the numbers list. */ public static BigDecimal min(List<BigDecimal> numbers) { return new TreeSet<BigDecimal>(numbers).first(); } }