This week's book giveaway is in the HTML/CSS/JavaScript forum.
We're giving away four copies of Practical SVG and have Chris Coyier on-line!
See this thread for details.
Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Extending Thread over Implementing Runnable

 
Udaya Wijenayake
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What are the advantages of extending thread class over implementing runnable interface? If there are no advantages then why there is a thread class?
 
Shanky Sohar
Ranch Hand
Posts: 1051
Eclipse IDE Firefox Browser
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
both are same as thread class itself implements the runnable interface.
you can choose any one from them.but extending a class will always consider a bad programming practice
 
Lester Burnham
Rancher
Posts: 1337
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
See ExtendingThreadVsImplementingRunnable
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!