coderz.py

Keep Coding Keep Cheering!

Naming a Thread in Java

The Thread class offers ways to modify and retrieve a thread’s name. Each thread by default has a name, such as thread-0, thread-1, and so forth. By using the setName() method, we can modify the thread’s name. Below is the syntax for the setName() and getName() methods: Syntax: Example : Using setName() Method Output: Example […]

July 6, 2022 | Java | No comments

Advertisement