Online Java Compiler By
JavaTpoint.com
import java.math.BigDecimal; public class BigDecimalMaxExample1 { public static void main(String[] args) { //Creating BigDecimal objects BigDecimal bdValue_1, bdValue_2, bdMaxValue; // Assigning value into BigDecimal objects bdValue_1 = new BigDecimal("152207"); bdValue_2 = new BigDecimal("152208"); // It returns Max value bdMaxValue = bdValue_1 .max(bdValue_2); // Displaying max value System.out.println("Max Value among " + bdValue_1 + " and " + bdValue_2 + " is = " +bdMaxValue); } }
Output