A ThreadGroup represents a set of threads. A thread group can also include the other thread group.
It offers a convenient way to manage groups of threads as a unit. This is particularly valuable in situation in which you want to suspend and resume a number of related threads.
Some of the important methods defined in ThreadGroup
activeCount() : provides the number of active threads in the thread group and its subgroups.
activeGroupCount() : provides the number of active groups in the thread group and its subgroups.
destroy() : destroys the thread group and all of its subgroups.
interrupt() : interrupts all threads in the thread group.
suspend() : suspends all threads in the thread group.
stop() : stops all threads in the thread group.
Output