Why does Thread Class implements Runnable Interface

This question already has an answer here:

  • Why does Thread implement Runnable? 2 answers

  • "The Runnable interface should be implemented by any class whose instances are intended to be executed by a thread. [...] This interface is designed to provide a common protocol for objects that wish to execute code while they are active. For example, Runnable is implemented by class Thread."

    oracle doc

    But I think what your exactly looking for is here. The answer given was "backward compability". Sometimes Java needs to make choices, and they always chose solutions dealing with backward compability.


    If Thread class doesn't implement Runnable then Thread class will not have run method. Then jvm will not treat it as a thread at all.

    链接地址: http://www.djcxy.com/p/92122.html

    上一篇: 我怎样才能杀死一个线程? 不使用stop();

    下一篇: 为什么Thread类实现Runnable接口