Sleep is used to sleep when a thread is called, and other threads cannot occupy the CPU. The OS considers that the thread is working and does not let out system resources. Wait enters the waiting pool to wait, other threads can occupy CPU resources. Generally, wait does not apply a time limit, because it is useless if the resources of the wait thread are not enough, wait for other threads to call the yyall method to wake up all the threads in the wait pool before entering the ready sequence to wait for the OS to allocate system resources. Sleep is a static method, who falls to bed, even if the sleep method of thread B is called in the main thread, the main thread is actually used to go to bed. To let thread B go to bedCodeSleepsleep (100 L) is used for CPU usage, the thread sleep for milliseconds, other processes can no longer use CPU resources, and wait (l) is used for waiting in the waiting pool, the CPU and other system resources are handed over for other processes. During these 100 milliseconds, this thread can be used by other threads notify. However, the difference is that other threads in the waiting pool will not be freed from being destroyed by notify, but this thread will automatically enter the ready queue after waiting for 100 milliseconds and wait for the system to allocate resources. In other words, sleep (100) will certainly run after 100 milliseconds, however, after 100 milliseconds, wait still waits for the OS to call and allocate resources. Therefore, the wait100 stop time is uncertain, but at least 100 milliseconds.