Quantcast
Channel: What is a daemon thread in Java? - Stack Overflow
Viewing all articles
Browse latest Browse all 28

Answer by Arman Tumanyan for What is a daemon thread in Java?

$
0
0

JVM will accomplish the work when a last non-daemon thread execution is completed. By default, JVM will create a thread as nondaemon but we can make Thread as a daemon with help of method setDaemon(true). A good example of Daemon thread is GC thread which will complete his work as soon as all nondaemon threads are completed.


Viewing all articles
Browse latest Browse all 28

Trending Articles