Home » Java ThreadGroup setMaxPriority() method with Examples

Java ThreadGroup setMaxPriority() method with Examples

by Online Tutorials Library

Java ThreadGroup setMaxPriority() method

The setMaxPriority() method of ThreadGroup class is used to set the maximum priority of the group.

Syntax

Parameter

pri: It is the new priority of the thread group.

Example

Test it Now

Output:

Thread-1 starts  Thread-2 starts  Thread-1 [priority = 7]  Thread-2 [priority = 1]  Thread-2 finished execution  Thread-1 finished execution  

You may also like