Prashant Ameta wrote:Hii,I have a question Regarding threads
There are two ways to create a thread-
1.)by Extending the Thread class
2.)by implementing Runnable interface
which one is better and how would one decide???
Thanks in advance
1.)When do you extend a class ??
2.)When do you implement an interface ??
as Jeff Verdegan have already told you that this question is more about inheritance and class design.
Then If you can answer these question then you can answer your own questions too.
If you can't answer these then you should study more about inheritance first before start Thread.
OCPJP 6 86%
Be reasonable. You can't destroy everything. Where would you sit? How would you read a tiny ad?