The 'parseInt' method of the 'Integer' class throws a 'NumberFormatException' when it is passed a String argument that it cannot convert to an int. Given the String variable s (which has already been assigned a value), write the code needed to convert the value in s as ________.

Respuesta :

Answer:

new BigInteger(s);

See the explanation

Explanation:

Since "parseInt" throws a 'NumberFormatException"; the best solution will be to use 'BigInteger'. Since 's' is already assigned a value, we can print it out as:

System.out.println(new BigInteger(s));

The BigInteger class might need to be imported to the class using:

import java.math.BigInteger;

ACCESS MORE