What is displayed on the console when running the following program?
```
public class Test {
public static void main(String[] args) {
try {
method();
System.out.println("After the method call");
}
catch (RuntimeException ex) {
System.out.println("RuntimeException");
}
catch (Exception ex) {
System.out.println("Exception");
}
}
static void method() throws Exception {
try {
String s = "5.6";
Integer.parseInt(s); // Cause a NumberFormatException
int i = 0;
int y = 2 / i;
System.out.println("Welcome to Java");
}
catch (NumberFormatException ex) {
System.out.println("NumberFormatException");
throw ex;
}
catch (RuntimeException ex) {
System.out.println("RuntimeException");
}
}
}```
a. The program displays NumberFormatException twice.
b. The program displays NumberFormatException followed by After the method call.
c. The program displays NumberFormatException followed by RuntimeException.
d. The program has a compile error.
c
You might also like to view...
What are some steps you should take before performing an upgrade on a mission-critical server? When should you use rpm –i instead of rpm –U?
What will be an ideal response?
To add an appointment to your Calendar, select the day for which you want to set up the appointment, and then on the View tab, in the New group, click the New Appointment button.
Answer the following statement true (T) or false (F)
In a spreadsheet a(n) ______ is a predefined formula that performs a calculation.
Fill in the blank(s) with the appropriate word(s).
According to Kant, our sense of “ought to” is called
a. necessity.
b. insecurity.
c. paranoia.
d. love.
e. dutifulness.