wood burning stoves*
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 Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Threads and Synchronization
Bookmark "priortiy" Watch "priortiy" New topic
Author

priortiy

abalfazl hossein
Ranch Hand

Joined: Sep 06, 2007
Posts: 635


When I run this code , this massage shows :

compile:
run:
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
Marshal

Joined: Mar 22, 2005
Posts: 41032
    
  43
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: http://aspose.com/file-tools
 
subject: priortiy
 
Similar Threads
How to wait for multiple thread to finish run
Threads
join()
Thread, Runnable interface, simple question
thread class execution explanation required