Java: how to assign name to thread... when implementing runnable?

Hello Experts,

how do I assign a name to a thread when implementing runnable?

public class Test implements Runnable {

}

Thanks for your help experts,

regards
epifanio67Asked:
Who is Participating?
 
CPColinSenior Java ArchitectCommented:
Hi epifanio67,

You can either call setName() on the thread when you create it or call Thread.currentThread().setName() at the start of your run() method.
0
 
epifanio67Author Commented:
thank you expert...
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.