Java Data Type Tutorial - Java BigInteger .multiply (BigInteger val)








Syntax

BigInteger.multiply(BigInteger val) has the following syntax.

public BigInteger multiply(BigInteger val)

Example

In the following code shows how to use BigInteger.multiply(BigInteger val) method.

// ww  w .  j a v a2s .co m
import java.math.BigInteger;

public class Main {

  public static void main(String[] args) {

    BigInteger bi1 = new BigInteger("7");
    BigInteger bi2 = new BigInteger("20");

    // multiply bi1 with bi2 and assign result to bi3
    BigInteger bi3 = bi1.multiply(bi2);

    System.out.println(bi3);
  }
}

The code above generates the following result.