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) 99
B) 997
C) 0
D) 1
Correct Answer:
Verified
Q7: The call stack is an internal list
Q8: If the class SerializedClass contains references to
Q14: When an exception is thrown by a
Q16: When an object is serialized, it is
Q20: A catch clause that uses a parameter
Q46: Beginning in Java 7, multi-catch can reduce
Q47: When deserializing an object using the readObject
Q52: A class must implement the Serializable interface
Q53: If a random access file contains a
Q54: The throw statement informs the compiler that
Unlock this Answer For Free Now!
View this answer and more for free by performing one of the following actions
Scan the QR code to install the App and get 2 free unlocks
Unlock quizzes for free by uploading documents