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 extend immutable class?
Is java util list serializable?
What is exception in java?
what is the purpose of the wait(), notify(), and notifyall() methods? : Java thread
Differece between class and generic class?
What is difference between length and length() method in java ?
What is a ternary operator in java? What is an interface?
What are different types of constants?
Which oo concept is achieved by using overloading and overriding?
Difference between this() and super() ?
Why do I need to declare the type of a variable in java?
What is java abstraction with example?
What is java developer skills?
What is the difference between ArrayList and Vector? which one is better in Java
Explain java coding standards for classes or java coding conventions for classes?