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
Why is java so important?
What do you mean by ordered and sorted in collections in java?
State the difference between strings and arrays.
Can variables be used in java without initialization?
What is the tradeoff between using an unordered array versus an ordered array?
What's the access scope of protected access specifier?
What is a prefix function.write down a code to compute prefix function.
What is the difference between Java1.4 and Java1.5
What is difference between path and classpath in java?
what is the use of pojo (plain old java objects)? how it is interact with crystal reports? pls urgent
Explain about serializable interface in java?
What is time complexity java?
5 Coding best practices you learned in java?
Why does java have two ways to create child threads? Which way is better?
What is off heap memory?