What is displayed on the console when running the following program?

```
public class Test {
public static void main(String[] args) {
try {
p();
System.out.println("After the method call");
}
catch (RuntimeException ex) {
System.out.println("RuntimeException");
}
catch (Exception ex) {
System.out.println("Exception");
}
}

static void p() 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 (RuntimeException ex) {
System.out.println("RuntimeException");
}
catch (Exception ex) {
System.out.println("Exception");
}
}
}
```
a. The program displays RuntimeException twice.
b. The program displays Exception twice.
c. The program displays RuntimeException followed by After the method call.
d. The program displays Exception followed by RuntimeException.
e. The program has a compile error.


c. The program displays RuntimeException followed by After the method call.

Computer Science & Information Technology

You might also like to view...

__________ allows the client to set up a "hijacker" process that will intercept selected application-level traffic and redirect it from an unsecured TCP connection to a secure SSH tunnel. ?

Fill in the blank(s) with the appropriate word(s).

Computer Science & Information Technology

Color also evokes an emotional response, in which certain colors are associated withparticular feelings or concepts, such as the color ____ for assertive, powerful, sexy, and dangerous.

A. black B. orange C. blue D. red

Computer Science & Information Technology

To apply a 3D effect, choose the ____ command.

A. Expand B. Warp C. Distort D. Extrude & Bevel

Computer Science & Information Technology

Databases and spreadsheet software can help collect data but not organize or edit it. 

Answer the following statement true (T) or false (F)

Computer Science & Information Technology