Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

import java.math.BigDecimal;
import java.math.BigInteger;

public class Main {

    public static void main(String[] args) {
        BigDecimal bg1 = new BigDecimal("2426");
        // assign the BigIntegerExact value of bg1 to i1
        BigInteger i1 = bg1.toBigIntegerExact();

        System.out.println("BigInteger value of " + bg1 + " is " + i1);
    }
}