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
Can list have duplicates in java?
Does .length start 0 java?
What is meant by class loader? How many types are there?
What is the dot operator?
Is arraylist ordered?
Is 0 true or false?
How to check if a list is sorted in java?
How do I print a “?
How do you calculate roots in java?
What does file separator do in java?
What all access modifiers are allowed for top class ?
Can we use string in the switch case?
What is meant by 'bit masking' in java?
How does regex work?
What are the ways in which a thread can enter the waiting state?