Method to change the name of a thread - Core Java

Q.  Which method is used to change the name of a thread?
- Published on 22 Jul 15

a. public String getName()
b. public void setName(String name)
c. public void getName()
d. public String setName(String name)

ANSWER: public void setName(String name)
 

    Discussion

  • Prajakta Pandit   -Posted on 14 Dec 15

    - public void setName(String name) method is used to change the name of a thread.

    - This method does not return any value.

    - The 'name' attribute is the new name for the thread.

Post your comment / Share knowledge


Enter the code shown above:

(Note: If you cannot read the numbers in the above image, reload the page to generate a new one.)