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
Which package has light weight components?
What is the synchronized method modifier?
What is substring 1 in java?
Is class is a data type?
How does multithreading take place on a computer with a single cpu?
What is runtime locatable code?
List the different types of classloaders in java.
Can we sort list in java?
How do you sort a set in java?
What is vector?
What are bind parameters?
explain local datetime api in java8?
How do you access command-line arguments within the code?
What is the use of java?
How to print nodes of a Binary tree?