What is the setPriority() method?
Are you preparing for IT certification? With practice questions, study notes, interactive quizzes, tips and technical articles, uCertify PrepKits ensure that you get a solid grasp of core technical concepts to ace your certification exam in first attempt.
What is the setPriority() method?
Rating:
The setPriority() method is a method of the Thread class. This method is used to change the priority of a thread. The general syntax of this method is as follows:
The p parameter specifies the priority of a thread.
If the specified priority is not within the MIN_PRIORITY to the MAX_PRIORITY range, then an IllegalArgumentException is thrown.
The MIN_PRIORITY value defines the minimum priority. Its constant value is 1.
The MAX_PRIORITY value defines the maximum priority. Its constant value is 10.
Rating:
Was this information helpful?
Other articles
- What is the getTimeout() method?
- What is the setTransform() method?
- What is the unregisterConnection() method?
- What is the setLoopCount() method?
- What is the Canvas class?