81
Java ThreadGroup list() method
The list() method of ThreadGroup class is used to display the information about the thread group. It is useful only for debugging.
Syntax
Return
This method does not return any value.
Example
Output:
Thread-1 starts Thread-2 starts Listing parentThreadGroup: Parent thread: java.lang.ThreadGroup[name=Parent thread,maxpri=10] Thread[Thread-1,5,Parent thread] Thread[Thread-2,5,Parent thread] java.lang.ThreadGroup[name=Child thread,maxpri=10] Thread-1 completed executing Thread-2 completed executing
Next TopicMultithreading Java