This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
Basically this is all there is to know about daemon threads:
1. You can have two types of threads inside a Java program, user threads and daemon threads. 2. A Java program terminates when all USER threads have died, regardless of the existence of any living daemon threads. 3. You can change the status of a thread by using the setDaemon method as long as the thread has not been started. If you try to change a started thread, you'll get an IllegalThreadStateException.
Relevant methods: final void setDaemon(boolean flag) If flag is true, the thread will become a daemon thread. Otherwise the thread becomes a user thread. (BTW, threads are created as user threads initially)
final boolean isDaemon() Returns true if the thread is a daemon thread; false if it is a user thread.