Home » Java ThreadGroup getName() method with Examples

Java ThreadGroup getName() method with Examples

by Online Tutorials Library

Java ThreadGroup getName() method

The getName() method of ThreadGroup class returns the name of this thread group.

Syntax

Return

This method returns the name of thread group.

Example

Test it Now

Output:

First threadGroup's name: Parent thread  Thread-1 is running  Second threadGroup's name: Child thread  Thread-2 is running  

You may also like