Java Data Type Tutorial - Java BigDecimal(int val) Constructor








Syntax

BigDecimal(int val) constructor from BigDecimal has the following syntax.

public BigDecimal(int val)

Example

In the following code shows how to use BigDecimal.BigDecimal(int val) constructor.

//from ww w  .ja  v a  2 s.com
import java.math.BigDecimal;

public class Main {

  public static void main(String[] args) {
    BigDecimal bg1 = new BigDecimal(123);
    System.out.println(bg1);

  }
}

The code above generates the following result.