Online Java Compiler By
JavaTpoint.com
import java.math.BigDecimal; public class BigDecimalMinExample2 { public static void main(String[] args) { //Creating BigDecimal objects BigDecimal bdValue_1, bdValue_2, bdMinValue; // Assigning value into BigDecimal objects bdValue_1 = new BigDecimal("-1133"); bdValue_2 = new BigDecimal("-1135"); // 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