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 constructor chaining in java?
Can classes declared using the abstract keyword cab be instantiated?
What is the benefit of inner / nested classes ?
Write a code to show a static variable?
What is Major and importance difference between for and foreach loop ?
List the three steps for creating an object for a class?
Explain importance of inheritance in java?
What is the length of a string?
What is the set interface in java programming?
How to change the priority of thread or how to set the priority of thread?
Can you extend main method in java?
How to compare two strings in java program?
What are design patterns and please explain?
which pattern is default in scanner package?
Differentiate between overriding and overloading cases?