Javatpoint Logo
Javatpoint Logo

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





Youtube For Videos Join Our Youtube Channel: Join Now

Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA