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.


/*from www .  j  a v a 2  s  . c  om*/
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.





















Home »
  Java Tutorial »
    java.math »




BigDecimal
BigInteger