Online Java Compiler By
JavaTpoint.com
import java.math.BigDecimal; public class BgDecimalIntValueExample1 { public static void main(String[] args) { // Create BigDecimal object BigDecimal bdValue; //Create int variable int integerValue; //Assigning value into BigDecimal object bdValue = new BigDecimal("3545"); //It returns int value of BigDecimal integerValue = bdValue.intValue(); //Displaying int Value System.out.println( "Returned int value is = "+integerValue); } }
Output