permaculture playing cards*
The moose likes Threads and Synchronization and the fly likes priortiy Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Threads and Synchronization
Bookmark "priortiy" Watch "priortiy" New topic


abalfazl hossein
Ranch Hand

Joined: Sep 06, 2007
Posts: 635

When I run this code , this massage shows :

Exception in thread "main" java.lang.IllegalArgumentException
at java.lang.Thread.setPriority(
at priority.Main.main(
Java Result: 1
BUILD SUCCESSFUL (total time: 0 seconds)

How can I fix it?I use netbeans and windows
Ulf Dittmer

Joined: Mar 22, 2005
Posts: 41599
The priority value needs to fall into the range [Thread.MIN_PRIORITY, Thread.MAX_PRIORITY] - you're using a value that does not.

Ping & DNS - my free Android networking tools app
abalfazl hossein
Ranch Hand

Joined: Sep 06, 2007
Posts: 635
You are right! I mistake!zero isn't
Srikkanth Mohanasundaram
Ranch Hand

Joined: Feb 07, 2007
Posts: 185
Does this resolve the issue?
I agree. Here's the link:
subject: priortiy