71
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
Output:
Thread-0 Thread-1
Next TopicMultithreading in Java