Click here to Skip to main content
       

Java

 
QuestionThread names PinmemberCsTreval4-Oct-12 1:19 
AnswerRe: Thread names PinmemberNagy Vilmos4-Oct-12 2:54 
Simply put you are addressing the Thread method not the MyThreadRunnable method. You could change your code thus and it would work as expected:
 
MyThreadRunnable runnable = new MyThreadRunnable();
Thread thread = new Thread(runnable, "runnable1");
runnable.setName(thread.getName());
thread.start();


Panic, Chaos, Destruction. My work here is done.
Drink. Get drunk. Fall over - P O'H
OK, I will win to day or my name isn't Ethel Crudacre! - DD Ethel Crudacre
I cannot live by bread alone. Bacon and ketchup are needed as well. - Trollslayer
Have a bit more patience with newbies. Of course some of them act dumb - they're often *students*, for heaven's sake - Terry Pratchett

AnswerRe: Thread names PinmemberGowtham Gutha15-Nov-12 7:11 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Advertise | Privacy | Mobile
Web01 | 2.8.140721.1 | Last Updated 1 Aug 2014
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid