why Runnable interface is preferable than extending the
Thread class?

Answer Posted / srinu

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 ?    6 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain exception chaining in java?

611


Why does java doesnt suuport unsigned values?

1798


How do you calculate square roots?

581


Is there any way to skip finally block of exception even if some exception occurs in the exception block?

600


23. Storage space in java is of the form Stack Queue Heap List 24. What is java code embedded in a web page known as Applets Servlets scriptlets snippets 25. Which of the following attributes are compulsory with an tag?. code,height & width. 26. What does 'CODEBASE' in an applet tag specify?. Files absolute path.

2062






How many bytes are there?

541


What is difference between identifier and variable?

477


List some java keywords sun like c, c + + keywords?

592


List out benefits of object oriented programming language?

487


What is a java string?

544


Which variables are stored in heap?

543


Do we have pointers in java?

532


make a method which any number and any type of argument and print sum of that arguments.....

1385


How do you allocate memory to object?

520


Are primitives objects?

566