Skip to content

Instantly share code, notes, and snippets.

@jburwell
Created September 1, 2016 17:43
Show Gist options
  • Save jburwell/03545eff61f957820a50297d89670017 to your computer and use it in GitHub Desktop.
Save jburwell/03545eff61f957820a50297d89670017 to your computer and use it in GitHub Desktop.
public final class ExceptionHandling {
private static void throwExceptionInFinallyBlock() {
try {
System.out.println("Doing the do ...");
} catch (Exception e) {
System.out.println("Caught exception " + e);
} finally {
System.out.println("In the finally block");
throw new IllegalStateException("Failing in the finally block ...");
}
System.out.println("Doing work after the try block");
}
public static void main(String... theArguments) {
throwExceptionInFinallyBlock();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment