• Post Reply Bookmark Topic Watch Topic
  • New Topic

Extending Thread or Implementing Runnable  RSS feed

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I actually got this shooter and didn't find one reason to support my answer.
The question was why is the advantage of extending Thread class to make threads rather than implemting Runnable(not the other way around).
Though it sounded weird, I could not figure out the answer.
 
Ranch Hand
Posts: 1183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually, it's better practice to implement Runnable than extending Thread. It keeps the option of having your class extend from something else later.
 
Bartender
Posts: 2700
IntelliJ IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is even an FAQ for this question.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!