Quantcast
Viewing latest article 41
Browse Latest Browse All 45

Answer by Jon Skeet for "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.


Viewing latest article 41
Browse Latest Browse All 45

Trending Articles