One, the thread stops:
There is a stop () method, which, while still available, is obsolete, and therefore recommends the following methods.
1, stop a thread: we generally will be controlled by a variable.
2, if you need to stop a thread in the waiting state, then we need to use the variable with the Notify method or interrupt ().
Prerequisite: A thread that is in a waiting (blocking) state may keep the program running.
1) Notify (): Occasionally can stop.
2) Interrupt (): The thread's waiting state is forced to clear, the purged state of the thread will receive a Interruptedexception exception.
Second, the Guardian thread
1, daemon thread (background thread): If only a daemon thread is left in a process, then the daemon will die.
2, note: A thread default is not a daemon thread.
3, demand: Analog QQ download update package.
Three, join () method Detailed:
1, join (): Join.
2. Demand:
3, the solution: