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.
It returns the number of active thread groups with this thread group as an ancestor.
ExampleTest it Now
Thread-1 starts Number of active thread group: 2 Thread-1 completed executing