Home » Java ThreadGroup activeGroupCount() method with Examples

Java ThreadGroup activeGroupCount() method with Examples

by Online Tutorials Library

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  

You may also like