Saturday 16 March 2013

What are the various ways of creating a thread. What is difference between them?

What are the various ways of creating a thread. What is difference between them? 
1> Implementing Runnable interface.
2>Extending
 Thread class.

First case we have to override run method of the interface. Also if we want to inherit any other class in our thread then first case is appropriate and useful option, because with the second case we can’t inherit any other class.



Blog Author: Vijay Kumar

Go to: Coding Problem Solutions

No comments: