Java / Concurrent collections
What is shutdown hook in Java Thread?
A shutdown hook is simply a thread that JVM invokes implicitly before it shuts down.
When the JVM begins its shutdown sequence it starts all registered shutdown hooks in a random order and let runs it concurrently. When all the hooks have completed its execution JVM will then run all uninvoked finalizers if finalization-on-exit has been enabled. Finally, the virtual machine will halt.
More Related questions...