The difference between the two methods
1) Start:
Usage:
The Start method starts the thread and actually implements the multithreaded run, without having to wait for the Run method body code to complete and proceed directly to the following code. By invoking the thread class's
Run () is called the thread body, which contains the contents of the thread to be executed, and the Run method ends and the thread terminates.
2) Run:
Run ()
method is just a common method of the class, if you call the Run method directly, the program is still only the main thread of the threads, its program execution path is only one, or to execute sequentially, or to wait
After execution of the Run method body is complete, the following code can continue to execute, so that the purpose of the write thread is not reached. Summary: Call the Start method to start the thread, and the Run method is just a thread
Run () method, which is specified by the JVM's memory mechanism. and the run () method must be public access, and the return value type is void:
Comparison between the two methods:
In practice, the implementation of Runable interface is often used, on the one hand, because Java only supports single inheritance, inheriting the thread class can no longer inherit other classes, and the Runable interface has only one run method, on the other hand, through the results can be seen to implement Runable interface is the real multi-threading ... ...
Reference Link: https://zhidao.baidu.com/question/1496082367158609459.html
The difference between the start and runnable methods of Java