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
Can a top level class be private or protected?
Can we call the run() method instead of start()?
Write a program to show whether a graph is a tree or not using adjacency matrix.
What is the use of put method?
What is the purpose of the runtime class in java programming?
Why string is not thread safe?
What is a wrapper method?
What is callable java?
What is number data type?
What is the difference between stringbuffer and stringbuilder?
What are the two types of java programming?
What is equals method in java?
Garbage collection in java?
Write a program to find maximum and minimum number in array?
What is mnemonic code?