1. start () methodTo start the thread and realize multi-threaded running. In this case, you do not have to wait until the run method code is executed successfully and directly continue to execute the following code:
Start a Thread by calling the start () method of the Thread class,
This thread is in the ready state,
Not running.
Then, the Thread class calls the method run () to complete its operation,
Here the run () method is called the thread body,
It contains the content of the thread to be executed,
The Run method is finished,
This thread is terminated,
The CPU then runs other threads,
2. run () methodThe program must be executed in sequence as a normal method, or the following code can be executed after the run method is completed:
If you directly use the Run method,
This is just to call a method,
The program still has only the main thread-this thread,
There is only one program execution path,
In this way, the write thread is not achieved.