Online Java Compiler By
JavaTpoint.com
import java.math.BigDecimal; public class BigDecimalMinExample1 { public static void main(String[] args) { //Creating BigDecimal objects BigDecimal bdValue_1, bdValue_2, bdMinValue; // Assigning value into BigDecimal objects bdValue_1 = new BigDecimal("537"); bdValue_2 = new BigDecimal("535"); // It returns Minimum value bdMinValue = bdValue_1 .min(bdValue_2); // Displaying minimum value System.out.println("Minimum Value among " + bdValue_1 + " and " + bdValue_2 + " is = " +bdMinValue); } }
Output