Java ThreadGroup getParent() method
The getParent() method of ThreadGroup class returns the parent of the thread group.
This method returns the parent of the thread group.
SecurityException: If the current thread cannot modify the thread group.
ExampleTest it Now
Starting Thread-1 Starting Thread-2 ParentThreadGroup for Parent thread is main ParentThreadGroup for Child thread is Parent thread Thread-1 completed executing Thread-2 completed executing