Quantcast
Channel: JavaPins - Stories tagged with jvm
Viewing all articles
Browse latest Browse all 26

Runtime.addShutdownHook()

$
0
0
Every Java Program can attach a shutdown hook to JVM, i.e. piece of instructions that JVM should execute before going down. A program may require to execute some pieces of instructions when application goes down. An application may go down because of several reasons: Because all of its threads have completed executionBecause of call to System.exit()Because user hit CNTRL-CSystem level shutdown or User Log-OffFew scenarios where this requirement fits are: Saving application stat...
Pin it

Viewing all articles
Browse latest Browse all 26

Trending Articles