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
Why singleton is not thread safe?
Which sort is best in java?
What is the purpose of static keyword in java?
What is abstract class constructor called?
Where is core java used?
Is there any limitation of using inheritance?
What are the two types of java?
How can you share data between two thread in Java?
Does treeset use compareto?
What is the difference between static and non-static variables in java programming?
How do I stop concurrentmodificationexception?
Do we need to manually write Copy Constructor?
What is the format specifier?
Is null false in java?
Can list have duplicates in java?