“implements Runnable” vs “extends Thread” in Java

Yes: implements Runnable is the preferred way to do it, IMO. You’re not really specialising the thread’s behaviour. You’re just giving it something to run. That means composition is the philosophically “purer” way to go.

In practical terms, it means you can implement Runnable and extend from another class as well… and you can also implement Runnable via a lambda expression as of Java 8.

Leave a Comment