wood burning stoves 2.0
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Thread Priority Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Thread Priority" Watch "Thread Priority" New topic

Thread Priority

josephine chen
Ranch Hand

Joined: Oct 29, 2002
Posts: 216
"m" will get the NORM_PRIORITY priority
or the priority of the thread that created it
that is can I say it is main thread
class A {
public static void main (String g[]){
Thread m = new Thread();

Joined: Feb 03, 2000
Posts: 16
If no explicit thread priority is set for a given thread, then the thread's priority is defaulted to 5 or Thread.NORM_PRIORITY.
add this line after the thread declaration:
and you'll see that it is 5.
Tony Alicea

Joined: Jan 30, 2000
Posts: 3226
No, no... The new thread priority is the same as priority of the thread doing the creation. It is inherited.

Tony Alicea
Senior Java Web Application Developer, SCPJ2, SCWCD
I agree. Here's the link: http://aspose.com/file-tools
subject: Thread Priority
It's not a secret anymore!