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


Please Help Members By Posting Answers For Below Questions

If a method is declared as protected, where may the method be accessed?

756


Define "Access specifiers" in java.

946


What is hash in java?

723


Can we able to pass objects as an arguments in java?

794


Is static variable stored in heap?

717


What is abstract class? Explain

794


What is ternary operator in java?

829


What is difference between local variable and global variable?

731


How many types of the indexof method are there for strings?

732


Can we convert integer to string in java?

836


How to create a custom exception?

762


Which software is used for java programming?

782


What is final variable?

708


Difference between nested and inner classes ?

824


Is a string literal?

744