posted 8 years ago
Think about it from an 00 perspective. What's the purpose of subclassing? Remember that we're talking about two different things here-the Thread and the thread'slob. From an 00 view, those
two are very separate activities, and belong in separate classes. The only time you want to subclass/extend
the Thread class,Is if you are making a new and more specific type ofThread.ln other words, if you think of the Thread as the worker, don't extend the Thread class
unless you need more specific worker behaviors. But If all you need Is a new lob to be run by a Thread/worker, then Implement Runnable In a separate,job-specific
(not worker-specific) class. This is a design Issue and not a performance or language Issue.It's perfectly legal to subclass Thread and override the runO method, but It's rarely a good Idea.