Created
March 2, 2010 20:29
-
-
Save mkristian/319889 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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