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

Answer:

B: 256


pow()

public BigInteger pow( int exp )

Returns a BigInteger whose value is the integer raised to the power exp. Throws an ArithmeticException if exp is negative.

Notice that the exponent is an int, not a BigInteger. An int can be as large as two billion and it is unlikely you will need an exponent larger than this.

Of course, an integer raised to an integer power results in an integer, so BigInteger is the appropriate data type.


QUESTION 23:

What would you do if you need to raise an integer to a non-integer power?


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