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

Can we have two methods in a class with the same name?

803


What is the disadvantage of java?

715


What is == in java?

764


What is a pointer and does java support pointers?

780


What is argument in java?

764


How hashmap increases its size in java?

710


What is java argument list?

701


Can we create an object of private class?

736


how to create multithreaded program? : Java thread

707


Difference between association, composition and aggregation?

753


What is immutability in java?

814


What are the two ways in which thread can be created?

812


What is the meaning of find and replace?

726


Which sorting is best in java?

749


What is instance synchronization?

809