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
Difference between linkedlist and arraylist.
Addition to previous section relative word 5th one was Putrid ans: rotten, also there was prob. in 1st section on bucket weight ans:10kg, also there was a prob. on train speed to find bridge length ans:800 mtrs.
Can a class be defined inside an interface?
What does regex mean?
Can vector have duplicates in java?
Will set allow duplicates in java?
Can a static class implement an interface?
what is session in java?
When throws keyword is used?
What are measurable parameters?
Can we nested try statements in java?
What is args length in java?
Why is a constant variable important?
What does || || mean in math?
What is a substitution variable?