101
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
Output:
Thread-1 starts Thread-2 starts Thread-1 [priority = 7] Thread-2 [priority = 1] Thread-2 finished execution Thread-1 finished execution
Next TopicMultithreading Java