Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Daemon Threads

 
Lalitha Gottumukkula
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

"The virtual machine exits whenever all non-daemon threads have completed."

What does this mean ?

What are Daemon threads and how do they differ from user threads ?
Pls. explain the behaviour of daemon threads with an example.

Thanks,
Lalitha.
 
miguel lisboa
Ranch Hand
Posts: 1281
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
first spot in google
 
nagaraj reddy
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As for as My Knowledge Concerned

in java u acn set a thread as Daemon thread by using setDaemon() method.Daemon threads will be running in background although your program completed.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic