Thursday 13 December 2018

Daemon threads



thread.setDaemon(true)

If you don't do that, and you run some infinite loop in your thread's run(), that code will keep on executing even after your main application finishes, i.e. it will never let JVM shutdown.


Generally used for helping the main app, as long as main app runs , like GC.


No comments:

Post a Comment