jQuery in Action, 3rd edition
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 OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 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(Thread.java:1015)
at priority.Main.main(Main.java:23)
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: 42958
The priority value needs to fall into the range [Thread.MIN_PRIORITY, Thread.MAX_PRIORITY] - you're using a value that does not.
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: 236
Does this resolve the issue?
I agree. Here's the link: http://aspose.com/file-tools
subject: priortiy
jQuery in Action, 3rd edition