Tuesday, 19 April 2011

What is a better way of creating multithreaded application? Extending Thread class or implementing Runnable?

 If a class is made to extend the thread class to have a multithreaded application then this subclass of Thread can not extend any other class and the required application will have to be added to this class as it can not be inherited from any other class. If a class is made to implement Runnable interface, then the class can extend other class or implement other interface.

No comments:

Post a Comment