BigDecimal num = new BigDecimal("10.5"); int intNum = num.intValue(); System.out.println(intNum); //Output: 10
BigDecimal num = new BigDecimal("10.6"); int intNum = num.setScale(0, RoundingMode.DOWN).intValue(); System.out.println(intNum); //Output: 10
BigDecimal num = new BigDecimal("10.123456789"); double doubleNum = num.doubleValue(); System.out.println(doubleNum); //Output: 10.123456789Package Library: java.math.BigDecimal is part of the java.math package.