Bookmark Topic Watch Topic
  • New Topic

Thread start( ) method , can only be called once?  RSS feed

 
ajit a
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Report post to moderator
hi all...
why cant i start thread again?
Thread t = new Thread()
t.start(); // calls run method of this thread
t.start();// while this does not call run method
why its so that we can only call start method only once?
thx in advance.
Ajit.
 
Ron Newman
Ranch Hand
Posts: 1056
  • Mark post as helpful
  • send pies
  • Report post to moderator
Once a thread has been start()ed,and its run() method has returned, it is dead. You can join() it but you can't re-startit.
 
Jim Yingst
Wanderer
Sheriff
Posts: 18671
  • Mark post as helpful
  • send pies
  • Report post to moderator
Please don't post the same question in different forums - it wastes people's time if they compose a reply to something that's already been answered elsewhere.
Normally ths forum would be the preferred place to post a threads question, but since your post in Intermediate has more replies I'll close this one instead. Follow up here.
[ August 17, 2002: Message edited by: Jim Yingst ]
 
    Bookmark Topic Watch Topic
  • New Topic
Boost this thread!