What will the following code display? String input = 99#7; int number; try { number
Fantastic news! We've Found the answer you've been seeking!
Question:
What will the following code display?
String input = "99#7";
int number;
try
{
number = Integer.parseInt(input);
}
catch(NumberFormatException ex)
{
number = 0;
}
catch(RuntimeException ex)
{
number = 1;
}
catch(Exception ex)
{
number = -1;
}
System.out.println(number);
a. | 0
| |
b. | -1
| |
c. | 99
| |
d. | 1
|
Related Book For
Posted Date: