Java Thread getId() methodThe getId() method is used to return the thread identifier. The thread ID is a unique positive number which was generated at the time of thread creation. The thread ID remains unchanged during its lifetime. When the thread is terminated, the ID of thread can be reused. SyntaxReturnExampleTest it NowOutput: Name of t1: Thread-0 Id of t1: 21 running... 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