82
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
Output:
Thread-1 starts Number of active thread group: 2 Thread-1 completed executing
Next TopicThreadGroup in Java