This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes setDaemon Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Reply Bookmark "setDaemon" Watch "setDaemon" New topic
Author

setDaemon

Zak Nixon
Ranch Hand

Joined: Sep 27, 2003
Posts: 126
Can anyone explain this method?
Thread t = new Thread();
setDaemon(t);
Thanks
Zak
Harwinder Bhatia
Ranch Hand

Joined: Oct 17, 2003
Posts: 150
Hi Zak

Thread t = new Thread();
setDaemon(t);

The setDaemon method in the Thread class is 'not' overloaded and is defined as:

It takes a boolean argument and 'not' a Thread object as argument. If your example is referring to the setDaemon method in the Thread class, then it will 'not' compile. If it's overridden in your custom class, then it's a whole different story.
Hope that will help.
Thanks
Harwinder
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: setDaemon
 
Similar Threads
IllegalThreadStateException
What is a daemon thread?
Calling methods before start()
threads!
Thread