Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

import java.math.BigDecimal;

public class Main {

    public static void main(String[] args) {

        // assign values to bg1 and bg2
        BigDecimal bg1 = new BigDecimal("-128");
        BigDecimal bg2 = new BigDecimal("48");

        byte i1 = bg1.byteValueExact();
        byte i2 = bg2.byteValueExact();

        // print i1,i2 values
        System.out.println(i1);
        System.out.println(i2);
    }
}