Hi Friends, can you give difference between extending thread
class and implementing runnable interface.
Answer Posted / nagendra kumar
1.extends Thread and implements Runnable both are
fuctionally same.
2.If we use "extends Thread" then there is no scope to
extend another class because java doesn't multiple
inheritance.
3.If we use "implements Runnable" then there is a scope to
extend another class.This definately advantage why because
a programmer wants to extends a class and also use Thread
class features they must use Runnable interface.
| Is This Answer Correct ? | 2 Yes | 1 No |
Post New Answer View All Answers
What is the difference between the reader/writer class hierarchy and the inputstream/outputstream class hierarchy in java programming?
What is the different between get and post?
Explain wrapper classes in java?
What is return code?
What is java regex?
Lowest Common ancestor in a Binary Search Tree and Binary Tree.
What is the purpose of an interface?
What are different types of states exist for a thread?
what is optional in java 8?
How does linkedlist work in java?
Is it necessary for the port addresses to be unique? Explain with reason.
What is toarray method in java?
How is java hashmap implemented?
How can a gui component handle its own events in java programming?
Is void a wrapper class?