Java on kill method -


i have java program writes 1 file multiple files, not connections open @ same time.

i want add method remove of these created files when program killed (by using ctrl-c in command line).

adding shutdown hook executed when object shut down, want remove them if program killed. there runtimeexception can catch?

take @ runtime.getruntime().addshutdownhook(). here's example.


Comments