Home » Java Thread toString() Method with Examples

Java Thread toString() Method with Examples

by Online Tutorials Library

Java Thread toString() method

The toString() method of thread class is used to return the string representation of the thread, including the thread’s name, priority and thread group.

Syntax

Return

This method returns a string representation of the thread.

Example

Test it Now

Output:

Thread[Thread-0,5,main]  

You may also like