What is more advisable to create a thread, by implementing
a Runnable interface or by extending Thread class?

Answer Posted / bindhu solomon

Creating a thread using implementing Runnable interface
are more advisable. Suppose we are creating a thread by
extending a thread class, we cannot extend any other class.
If we create a thread by implementing Runnable interface,
we can extend another class.

Is This Answer Correct ?    6 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How does the java compiler work?

536


What is difference between stringbuffer and string?

502


Explain different states of a thread in java?

600


What does system.gc() and runtime.gc() methods do?

606


Does java vector allow null?

548






why Java does not support multiple inheritances?

712


What does indexof return in java?

547


What is the difference between integer parseint and integer valueof?

559


Who is the owner of java?

549


What is generics in java interview questions?

549


What is illegal identifier in java?

548


What is length in java?

581


Why is multiple inheritance not supported in java?

571


What is the difference between heap memory and stack memory?

626


How do I get a substring?

535