Java Thread getPriority() methodLast Updated : 17 Mar 2025 The getPriority() method of thread class is used to check the priority of the thread. When we create a thread, it has some priority assigned to it. Priority of thread can either be assigned by the JVM or by the programmer explicitly while creating the thread. The thread's priority is in the range of 1 to 10. The default priority of a thread is 5. SyntaxReturnIt returns the thread's priority. ExampleOutput: t1 thread priority : 5 t2 thread priority : 5 running thread name is:Thread-0 running thread name is:Thread-1 Next TopicMultithreading in Java |
We request you to subscribe our newsletter for upcoming updates.

We deliver comprehensive tutorials, interview question-answers, MCQs, study materials on leading programming languages and web technologies like Data Science, MEAN/MERN full stack development, Python, Java, C++, C, HTML, React, Angular, PHP and much more to support your learning and career growth.
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India