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
Can we define a package statement after the import statement in java?
What is an interface in java?
What is treeset in java?
Is age a discrete variable?
What is ide with example?
What 4 doubled?
what is nested class in java?
Which collection is sorted in java?
What are thread local variables?
Why is java called java?
Can you instantiate the math class?
Can you declare the main method as final?
How many JVMs can run on a single machine and what is the meaning of Just-In-Time (JIT) compiler?
What is set and get methods in java?
What is super in java?