Implementing Runnable vs extending Thread

As we already understood in previous article that there are 2 ways to create threads in Java 1. By Implementing Runnable interface 2. By Extending Thread class. But what is the best way to create thread ? There are few reasons why implementing Runnable interface is more preferable than extending Thread class Yes, implementing Runnable […]

Share this article on

Creating and starting Threads

Thread creation in Java ? We learned in our previous article that “ thread ” is an instance of “Thread” class. Please read Introduction-to-threads article before reading further. Threads can be created using any one of the 2 ways 1) Implementing the java.lang.Runnable interface. 2) Extending the java.lang.Thread class In both the ways, we need […]

Share this article on
< Previous Next >