Home » Java ThreadGroup toString() method with Examples

Java ThreadGroup toString() method with Examples

by Online Tutorials Library

Java ThreadGroup toString() method

The toString() method of ThreadGroup class returns a string representation of the Thread group.

Syntax

Return

It returns the string representation of the thread group.

Example

Test it Now

Output:

Thread-1 starts  Thread-2 starts  String equivalent: java.lang.ThreadGroup[name=parent thread group,maxpri=10]  String equivalent: java.lang.ThreadGroup[name=child threadGroup,maxpri=10]  Thread-1 completed executing  Thread-2 completed executing  

You may also like