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 |
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India