See the difference between the source code:
* Inherit thread: Because the subclass overrides the thread class's run (), when Start () is called, the Run () method of the subclass is searched directly
* Implement runnable: A reference to the runnable is passed in the constructor, the member variable remembers it, and start () calls the run () method internally to determine if the reference to the member variable runnable is empty, and does not empty compile-time view of the runnable run (), Run-time execution is a subclass of the run () method
Inherit thread
* Advantage: You can use the method in the thread class directly, the code is simple
* The disadvantage is that if you already have a parent class, you can't use this method
Implementing the Runnable Interface
* The advantage is that even if the thread class you define has a parent class, it doesn't matter because the parent class can implement the interface, and the interface can be implemented more
* The disadvantage is: you cannot directly use the method in thread, you need to get to the thread object before you can get thread method, code complex
Two different types of multithreading