Javatpoint Logo
Javatpoint Logo

Java ThreadGroup activeGroupCount() method

The activeGroupCount() method of ThreadGroup class returns an estimate of the number of active groups in this thread group and its subgroups. The returned value is only an estimate because the number of thread groups may change dynamically while this method traverses internal data structures.

Syntax

Return

It returns the number of active thread groups with this thread group as an ancestor.

Example

Test it Now

Output:

Thread-1 starts
Number of active thread group: 2
Thread-1 completed executing





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