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


Please Help Members By Posting Answers For Below Questions

Why singleton is not thread safe?

794


Which sort is best in java?

745


What is the purpose of static keyword in java?

733


What is abstract class constructor called?

798


Where is core java used?

778


Is there any limitation of using inheritance?

820


What are the two types of java?

767


How can you share data between two thread in Java?

743


Does treeset use compareto?

753


What is the difference between static and non-static variables in java programming?

719


How do I stop concurrentmodificationexception?

748


Do we need to manually write Copy Constructor?

796


What is the format specifier?

720


Is null false in java?

946


Can list have duplicates in java?

709