why Runnable interface is preferable than extending the
Thread class?
Answer Posted / praveen gupta
The main reason to implement Runnable interface is that you know that java does not supporting multiple inheritance
through classes .if u extend Thread class,u can't extend any
class which you required other than thread class.if u are
implementing runnable interface u can extend any class which
you required other than thread class.this is main advantage of
implementing java.lang.Runnable interface.
| Is This Answer Correct ? | 4 Yes | 0 No |
Post New Answer View All Answers
what is static import in java? Explain
What is a newline character in java?
What is an i/o filter?
What is java algorithm?
What is console based application in java?
Explain differences between collection api and stream api?
What is regex used for?
what is the purpose of "virtual"?
Can a function return a function?
how we can create packages in java?
What do you know about the garbage collector?
Can we have any code between try and finally blocks?
Can a class have 2 constructors?
What is final?
What is this keyword used for?