Examlex

Solved

Why Does the Following Code Cause a Compiler Error? Try

question 10

Multiple Choice

Why does the following code cause a compiler error? try
{
Number = Integer.parseInt(str) ;
}
Catch (IllegalArgumentException e)
{
System.out.println("Bad number format.") ;
}
Catch (NumberFormatException e)
{
System.out.println(str + " is not a number.") ;
}


Definitions:

Related Questions