Java ThreadGroup list() method
Java ThreadGroup list() method
Last Updated : 17 Mar 2025
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