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