Skip to content

Instantly share code, notes, and snippets.

@zbigniewTomczak
Created December 5, 2012 17:44
Show Gist options
  • Select an option

  • Save zbigniewTomczak/4217825 to your computer and use it in GitHub Desktop.

Select an option

Save zbigniewTomczak/4217825 to your computer and use it in GitHub Desktop.
System.exit in try block
public class SystemExitTry {
public static void main(String[] args) {
try {
System.out.println("try");
System.exit(0);
throw new RuntimeException();
} catch (Exception e) {
System.out.println("catch");
} finally {
System.out.println("finally");
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment