Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Why Java has a feature to create a thread by extending a thread  RSS feed

 
Ankit Agarwal
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why Java has a feature to create a thread by extending a Thread when it already has a way by implementing the Runnable interface?
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to JavaRanch.

You wouldn't extend the Thread class merely to start a thread, you would extend it if you wanted to add additional behavior to what the Thread class already does: http://www.coderanch.com/how-to/java/ExtendingThreadVsImplementingRunnable
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!