Java Thread currentThread() methodThe currentThread() method of thread class is used to return a reference to the currently executing thread object. SyntaxReturn valueIt returns the currently executing thread. ExampleTest it NowOutput: Thread-0 Thread-1
Next TopicMultithreading in Java
|