File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Use of implementing Runnable Interface

 
aresh babu
Ranch Hand
Posts: 65
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

can any one please let me know the use of implementing Runnable interace than extending a Thread class except achieveing the multiple inheritance??


Thanks
AreshBabu
 
Rajeev Rnair
Ranch Hand
Posts: 308
Java Linux Oracle
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think if you extend 'Thread', you cannot extend any other class.
But if you implement 'Runnable' you still can extend some class and implements other interfaces if you want to.

Other than that I don't know any differences.

note that "Thread" class also implements "Runnable" interface
that is why we can call

 
Ankit Garg
Sheriff
Posts: 9495
22
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Generally implementing Runnable is more common than extending Thread class. Extending the Thread class doesn't give you much that you can use...
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic