A friendly place for programming greenhorns!
Big Moose Saloon
Search
|
Java FAQ
|
Recent Topics
Register / Login
Win a copy of
The Mikado Method
this week in the
Agile and other Processes
forum!
JavaRanch
»
Java Forums
»
Java
»
Threads and Synchronization
Author
Extending Thread over Implementing Runnable
Udaya Wijenayake
Ranch Hand
Joined: May 15, 2009
Posts: 30
posted
Aug 16, 2010 12:50:38
0
What are the advantages of extending thread class over implementing runnable interface? If there are no advantages then why there is a thread class?
SCJP 1.5
Shanky Sohar
Ranch Hand
Joined: Mar 17, 2010
Posts: 1046
I like...
posted
Aug 16, 2010 14:06:21
0
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
SCJP6.0,
My blog
Ranchers from Delhi
Lester Burnham
Rancher
Joined: Oct 14, 2008
Posts: 1337
posted
Aug 16, 2010 15:11:56
0
See
ExtendingThreadVsImplementingRunnable
I agree. Here's the link:
http://ej-technologies/jprofiler
- if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
subject: Extending Thread over Implementing Runnable
Similar Threads
Multithreading
Extending Thread or implementing Runnable
threads
Runnable Interface VS Thread Class
best way to create a thread
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter