Created
July 15, 2019 10:05
-
-
Save Kaushal28/0a652b0d5f157638939b9b246f31bc0f 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
class ShutDownHookExample { | |
public static void main(String[] args) { | |
Runtime.getRuntime().addShutdownHook(new Thread() { | |
public void run() { | |
System.out.println("Shutdown hook is running."); | |
} | |
}); | |
System.out.println("Application terminating."); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment