What is a thread group?

What is a thread group?

A thread group represents a set of threads. Every Java thread is a member of a thread group. In addition, a thread group can also include other thread groups. Threads can only access the ThreadGroup to which they belong. Thread groups provide a mechanism for collecting multiple threads into a single object and manipulating those threads all at once, rather than individually. A tree structure can be formed from ThreadsGroups containing other ThreadGroups. 
Java provides the ThreadGroup class for creating and managing the thread groups. The ThreadGroup class provides two constructors :

ThreadGroup(String name)
ThreadGroup(ThreadGroup parent, String name)

Date:2016-01-09 00:00:00

Post Your Answers

User Email:

User Name:

Related Java Subjective Links

Java Subjective interview questions and answers for experienced and fresher