| Thejesh GN | A Blog, A Website and A container for all my views with excerpts from technology, travel, films, india, photography, kannada, friends and other interests. I am Thejesh GN. Friends call me Thej..more. |
![]() |
|
Simple shutdown hooks can often be written as anonymous inner classes, as in this example:
Runtime.getRuntime().addShutdownHook(new Thread() {
public void run() { call_ur_method(); }
});
This idiom is fine as long as you’ll never need to cancel the hook, in which case you’d need to save a reference to the hook when you create it. More about Java Application shutdown hook design Post a comment
|