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) -1
B) 0
C) 1
D) 99
Correct Answer:
Verified
Q49: In a catch statement, what does the
Q50: Assume that the classes BlankISBN, NegativePrice, and
Q51: What will be the result of the
Q52: Given the following constructor code, which of
Q53: If you want to append data to
Q54: If the data.dat file does not exist,
Q55: In Windows, which of the following statements
Q56: In the following code, assume that inputFile
Q57: The RandomAccessFile class treats a file as
Q59: If the code in a method can
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