Home » Java Thread currentThread() Method with Examples

Java Thread currentThread() Method with Examples

by Online Tutorials Library

Java Thread currentThread() method

The currentThread() method of thread class is used to return a reference to the currently executing thread object.

Syntax

Return value

It returns the currently executing thread.

Example

Test it Now

Output:

Thread-0  Thread-1  

You may also like