Here you can find the source of max(BigDecimal... values)
Parameter | Description |
---|---|
values | BigDecimal[] |
public static BigDecimal max(BigDecimal... values)
//package com.java2s; //License from project: Apache License import java.math.BigDecimal; public class Main { /**// w ww . ja v a2s . c o m * Finds maximum value from array of decimals. This method is null safe. * * @param values * {@Link BigDecimal[]} * @return */ public static BigDecimal max(BigDecimal... values) { BigDecimal maxValue = null; if (values != null) { for (BigDecimal value : values) { if (maxValue == null || value != null && value.compareTo(maxValue) >= 0) { maxValue = value; } } } return maxValue; } }