Hi Friends, can you give difference between extending thread
class and implementing runnable interface.

Answer Posted / ravikiran

By extending a thread class we will be restricted to the
implementation for single class only,by implementing
Runnable interface we will get extended for implementing
more than one thread

Is This Answer Correct ?    3 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is loop in java?

523


how we can make a read-only class in java?

539


Is java written in c?

537


Explain inheritance in java?

549


What interface is extended by awt event listeners?

588






What are different data structures in java?

524


Can a class be final?

494


How does thread synchronization occurs inside a monitor? What levels of synchronization can you apply?

535


What is thread safe in java?

544


What are the different approaches to implement a function to generate a random number?

563


How do you check if a string is lexicographically in java?

496


List implementations of list interface?

556


What about anonymous inner classes in java?

559


How can we use primitive data types as objects?

553


What is the intersection and union methods?

543