7 differences between extends Thread and implements Runnable in Java

Java provides multithreading to parallelize execution of tasks (code) and you need threads to run multiple things in parallel e.g. download a file in the background and show the progress bar at front-end. There are two ways to create a Thread in Java, first by extending java.lang.Thread class and second by implementing the java.lang.Runnable interface. Since interviewer loves comparison based questions, what is the  difference between extending thread and implementing Runnable is also a popular Java thread question. In this article, I'll tell you how to answer this question by explaining the difference between extending the Thread class and implementing the Runnable interface, and which one is the better way to create threads In Java. Both approaches have their pros and cons and there is a situation when extending Thread is logical but in most cases implementing Runnable is the better option. Let's see the difference between extends Thread and implements Runnable in Java.
Read more »