I\'m a Java rookie and I was wondering, if I have the following typical Java code
public class MyApp { public static void main(String[] args) { try {
Chris Cameron is correct. But normally a finally-block gets executed. Null pointer dereferece does exist in Java:
finally
try { List x = null; x.get(1); //throws the unchecked NullPointerException } finally { //will be executed }
The finally-Block gets executed.