Skip to content

Instantly share code, notes, and snippets.

@mkristian
Created March 2, 2010 20:29
Show Gist options
  • Save mkristian/319889 to your computer and use it in GitHub Desktop.
Save mkristian/319889 to your computer and use it in GitHub Desktop.
public class KillFinally {
public static void main(String[] args) {
Runtime.getRuntime().addShutdownHook(new Thread(){
public void run(){
System.out.println("shutdown");
}
});
try {
Thread.sleep(40000);
}
catch (InterruptedException iex) {
System.out.println("exception caught!" + iex.toString());
}
finally {
System.out.println("finally called!");
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment