This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes thread Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "thread" Watch "thread" New topic
Author

thread

shoba veran
Greenhorn

Joined: Apr 30, 2002
Posts: 9
hi guys:
Thread is a Deamon Thread or not please explain it ?
thanx


shoba
Amir Ghahrai
Ranch Hand

Joined: Jun 19, 2002
Posts: 110
You can create either deamon or non-deamon threads.
The main thread is a deamon thread. the threads the are created in the program are non-deamon thread, but you can make them as deamon thread by calling the setDeamon(true);


Amir
Dan Chisholm
Ranch Hand

Joined: Jul 02, 2002
Posts: 1865
The main difference between a User Thread and a Daemon Thread is that the program terminates when all user threads have stopped running.
A good example of a Daemon thread is the garbage collection thread. It just runs in the background like some sort of unseen ghost or demon.
The daemon attribute of a thread is just used to tell the JVM if it is OK to terminate the program even if the thread is still running.


Dan Chisholm<br />SCJP 1.4<br /> <br /><a href="http://www.danchisholm.net/" target="_blank" rel="nofollow">Try my mock exam.</a>
Marilyn de Queiroz
Sheriff

Joined: Jul 22, 2000
Posts: 9044
    
  10
shoba,

Welcome to JavaRanch! Please adjust your display name to meet the JavaRanch Naming Policy.
You can change it here.
Thanks!


JavaBeginnersFaq
"Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: thread
 
Similar Threads
Tech Word Game
subject
WA #1.....word association
Thread and Object
Thread & Synchronization