There are two ways to implement multithreading in Java: One is to inherit the thread class, and the other is to implement the Runnable interface.
1.java Why does the start thread use the start function?
Under the JDK installation path, Src.zip is the entire Java source program, and this code finds the definition of the start () method in thread, and you can see that the private native void Start0 () is used in this method;
Where the Native keyword means that the underlying function of the operating system can be called, then such a technique becomes a JNI technology (Java Native Interface).
2. Contact and difference:
The thread class, which has a constructor method: Public Thread (Runnable Targer) This construction method takes a subclass instance of Runnable, which means that the thread class is used to start the multithreading of the Runnable implementation. (Start () to coordinate the resources of the system).
In the program development of multithreading to implement Runnable interface, because the implementation of runnable interface compared to inherit the thread class, to avoid the limitations of inheritance, a class can implement multiple interfaces.
Runnable and Thread in Java