• Post Reply Bookmark Topic Watch Topic
  • New Topic

override start() method

 
pankaj patil
Ranch Hand
Posts: 98
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi

if i override start() method in both the way of creating the thread
ie extend Thread and implements Runnable

then sholud i call run() explicitly in both the start() method .

With Regards
Pankaj
 
Sravan Kumar
Ranch Hand
Posts: 121
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You do not override start() method either way. If you extend Thread, you override run() and if you implement Runnable, you implement run() method.

1. Do not call run() explicitly. It does not spawn a new Thread. It will then be treated as a normal method call and will be run in the same Thread.
2. Do not override start() method. Leave it alone!. Just call it on the Thread object to spawn a new Thread.
[ October 05, 2005: Message edited by: Sravan Kumar ]
 
pankaj patil
Ranch Hand
Posts: 98
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for reply
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!