What is displayed on the console when running the following program?
class Test {
public static void main(String[] args) {
| System.out.println("After the method call"); |
| catch (RuntimeException ex) { |
| System.out.println("RuntimeException"); |
| System.out.println("Exception"); |
}
static void method() throws Exception {
| Integer.parseInt(s); // Cause a NumberFormatException |
| System.out.println("Welcome to Java"); |
| catch (NumberFormatException ex) { |
| System.out.println("NumberFormatException"); |
| catch (RuntimeException ex) { |
| System.out.println("RuntimeException"); |
}
}
◦ The program displays NumberFormatException twice.
◦ The program displays NumberFormatException followed by RuntimeException.
◦ The program displays NumberFormatException followed by After the method call.
◦ The program has a compilation error.