Solved

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

Posted on 2013-02-01
2
307 Views
Last Modified: 2013-02-01
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
0
Comment
Question by:epifanio67
2 Comments
 
LVL 14

Accepted Solution

by:
CPColin earned 500 total points
Comment Utility
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
 

Author Closing Comment

by:epifanio67
Comment Utility
thank you expert...
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
This video teaches viewers about errors in exception handling.
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now