Javatpoint Logo
Javatpoint Logo

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






Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA