Java Thread currentThread() method

Last Updated : 17 Mar 2025

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

Output:

Thread-0
Thread-1