Home » Java ThreadGroup list() Method with Examples

Java ThreadGroup list() Method with Examples

by Online Tutorials Library

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

Test it Now

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  

You may also like