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
How do you check if a string is lexicographically in java?
Is sizeof a preprocessor?
What is the use of pattern in java?
How do I compare two strings in word in java?
What is the most important feature of java? What is an interface?
What is unicode used for?
Explain the difference between intermediate and terminal operations in java8?
How does finally block differ from finalize() method?
Define "Access specifiers" in java.
How to solve the problem of generating the unique hash keys with hash function?
Is java call by reference?
What is the purpose of garbage collection in java?
What is string data type?
Explain access modifiers in java.
What are the legal parameters?