1.

public class MyProgram { public static void throwit() { throw new RuntimeException(); } public static void main(String args[]) { try { System.out.println("Hello world "); throwit(); System.out.println("Done with try block "); } finally { System.out.println("Finally executing "); } } } which answer most closely indicates the behavior of the program?

A. The program will not compile.
B. The program will print Hello world, then will print that a RuntimeException has occurred, then will print Done with try block, and then will print Finally executing.
C. The program will print Hello world, then will print that a RuntimeException has occurred, and then will print Finally executing.
D. The program will print Hello world, then will print Finally executing, then will print that a RuntimeException has occurred.
Answer» E.


Discussion

No Comment Found

Related MCQs