Consider the following code:
1 public class exception
2 {
3 public static void main(
String args[])
4 {
5 System.out.println("A");
6 try
7 {
8 return;
9 }
10 catch(Exception e)
11 {
12 System.out.println("B");
13 }
14 System.out.println("C");
15 }
16 }
1. Compile time error in line no. 8 as main() method is declared void.
2. Program compiles correctly and prints "A" when executed.
3. Program compiles correctly and prints "A" and "C" when executed.
4. Compile time error at line no.14 due to statement not reached.
The answer 1 2.
Now, under what circumstances would line 14 be executed, if at all?
Isn't it unreachable code?