We have two methods to create methods the threads.
1. Implementing runnable interface
2. Extending to thread class and overriding run method.
Among these two which one is better and why?
Please explain me in detail.
Answer Posted / venkat
implementing runnable interface is better than extending to
thread why because if u implements from runnable interface u
can have chance to extend one more class.but incase of
extending thread this facility is not there
| Is This Answer Correct ? | 5 Yes | 0 No |
Post New Answer View All Answers
Is java free for businesses?
Which sorting is best in java?
Why isn’t there operator overloading?
Explain java coding standards for classes or java coding conventions for classes?
What is the base class in java from which all classes are derived?
Is it possible to use string in the switch case?
what is server side caching?
How to connect to a remote database using Applet?
Can extern variables be initialized?
What is functional interface in javatpoint?
Under what conditions is an object’s finalize() method invoked by the garbage collector?
What is the role of the java.rmi.naming class?
What is exception hierarchy in java?
What is a null check?
Difference between string, stringbuffer and stringbuilder?