| Author |
Thread Vs Runnable
|
Rohit Kumar
Ranch Hand
Joined: Sep 20, 2007
Posts: 53
|
|
What is difference between extending thread class and implementing Runnable interface. Any differnce rather than extends single class and implemet multiple interface? Regards, yogesh
|
 |
Peter Chase
Ranch Hand
Joined: Oct 30, 2001
Posts: 1970
|
|
|
Please search the Beginner forum for the many threads in which this has already been discussed.
|
Betty Rubble? Well, I would go with Betty... but I'd be thinking of Wilma.<br /> <br />#:^P
|
 |
Rob Spoor
Sheriff
Joined: Oct 27, 2005
Posts: 19232
|
|
When you implement Runnable you can re-run the same logic in another thread if needed. If you extends Thread then you can only start() it once. That'd be the main reason for using Runnables.
|
SCJP 1.4 - SCJP 6 - SCWCD 5
How To Ask Questions How To Answer Questions
|
 |
Jesper de Jong
Java Cowboy
Bartender
Joined: Aug 16, 2005
Posts: 12953
|
|
|
Yogesh, please check your private messages. You can see them by clicking My Private Messages.
|
Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
|
 |
Jesper de Jong
Java Cowboy
Bartender
Joined: Aug 16, 2005
Posts: 12953
|
|
|
Yogesh G - please check your private messages again.
|
 |
 |
|
|
subject: Thread Vs Runnable
|
|
|