Rob Prime wrote:Just be warned that those shutdown hooks are only called when the JVM is exiting properly, by having all non-daemon threads closed (including letting the main method end), calling System.exit(...), or closing a windowed application from the Windows task manager's first tab.
If your JVM is forcefully terminated, by a crash (e.g. caused by a bug in native code) or by terminating the process from the Windows task manager's second tab, it stops right there and then and no shutdown hooks are called.
yeal I get what you say.
this will not have serious impact on my program.
Anyway, Thank you for you remind。