What is daemon Thread?

Daemon threads are service threads which will run to provide service to other thread. 
Example gc thread is daemon thread for JVM.
Some facts about daemon threads are:
  • Daemon thread will be terminated immediately whenever depend thread task is completed.
  • We can mark the thread as Daemon with the following method:
                       void setDaemon(boolean);
  • We can find whether thread is Daemon or not with the following method:
                       boolean isDaemon();

                     
               

0 comments :

Post a Comment