can someone please explain why the System.out statement at line //1 didnt throw an 'unreachable code error'. i felt for sure that it would, as the call above it redirects it to another method.
are 'unreachable code' errors usually found in loops?
thank you.
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 block"); //1
}
catch (RuntimeException e) {
System.out.println("catch");
}
finally {
System.out.println("finally");
}
}
}