Created
April 11, 2016 17:09
-
-
Save marchof/9e439d5b766311276016cadcca23cefc to your computer and use it in GitHub Desktop.
JVM Shutdown
This file contains hidden or 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 Shutdown { | |
public static void main(String[] args) { | |
Runtime.getRuntime().addShutdownHook(new Thread() { | |
@Override | |
public void run() { | |
System.out.println("Shutdown Hook"); | |
} | |
}); | |
Thread.currentThread().interrupt(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment