Get the tools you need to learn Java skills fast!
Video tutorials, eBooks, hands-on lab exercises, sample code.
Get started
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Priority of Daemon threads Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Badass: Making Users Awesome this week in the Game Development forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Priority of Daemon threads" Watch "Priority of Daemon threads" New topic

Priority of Daemon threads

Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8920

What is the priority of Daemon threads?

Jessica Sant

Joined: Oct 17, 2001
Posts: 4313

The default priority of a thread is 5. (however you can change a thread's priority with .setPriority(int).
The priority of a thread is inherited from its parent thread, also the TYPE of thread (daemon or not) is inherited from the parent.
Check out this blip from the API for Thread

When code running in some thread creates a new Thread object, the new thread has its priority initially set equal to the priority of the creating thread, and is a daemon thread if and only if the creating thread is a daemon....

does that help?
[ February 14, 2003: Message edited by: Jessica Sant ]

- Jess
Blog:KnitClimbJava | Twitter: jsant | Ravelry: wingedsheep
subject: Priority of Daemon threads