Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Which is better “implements Runnable” over “extends Thread” to write a thread in Java?

Damian99Damian99 USAMember Posts: 116
edited February 2014 in Java

I came to know that there are 2 ways to write a thread using Java.

public class Thread1 implements Runnable { public void run() { //Code } }

public class Thread2 extends Thread { public Thread2() { super("Thread2"); } public void run() { //Code } }

What is the best approach in terms of performance?



Sign In or Register to comment.