File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Java in General and the fly likes Thread Vs Runnable Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Thread Vs Runnable" Watch "Thread Vs Runnable" New topic

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?

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.
Rob Spoor

Joined: Oct 27, 2005
Posts: 20193

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.

How To Ask Questions How To Answer Questions
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 15042

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 8 API documentation
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 15042

Yogesh G - please check your private messages again.
I agree. Here's the link:
subject: Thread Vs Runnable
It's not a secret anymore!