go to previous page   go to home page   go to next page highlighting

Answer:

b.add(c).multiply(a).add(d)

If the variables were int this would be

(b+c)*a + d


divide()

divide() works as expected. Look out for division by zero.

public BigInteger divide( BigInteger val )

Integer divide the BigInteger that contains the method by val. The result is returned in a new BigInteger. If val is zero, throw an ArithmeticException.

QUESTION 12:

BigInteger a = new BigInteger( "36" );
BigInteger b = new BigInteger( "10" );
BigInteger c = new BigInteger( "6" );
BigInteger z = BigInteger.ZERO;

What is the result of each of the following?


go to previous page   go to home page   go to next page