There are 6 states of Java threads:
1.New (new), when you create a new thread with new, the thread is in a nascent state, and the new state makes some preparation for the run of the thread, but it is not yet ready to run.
2.Runnable (can be run), calling the thread's start method to make the thread in a running state. The operational state does not necessarily mean that the thread is running, but that it has a running condition, it may be running, or it may not be running, depending on the thread scheduling control.
3.Blocked (blocked), when a thread attempts to acquire an internal object lock, the object lock is held by another thread, and the thread enters a blocking state.
4.Waiting (Wait) when the Object.wait method, Thread.Join method, lock or condition in the Java.util.concurrent library are called, the thread goes into a wait state.
5.Timed Waiting (wait on time), the condition that enters the state and the condition to enter the wait state are the same, but this state can wake up after a specified time, so it is different from the waiting state.
6.Terminated (terminated), Java does not have a way to directly terminate a thread (stop has been declared obsolete is not allowed to use, the Interrrupt method is only a request interrupt, not necessarily can interrupt a thread), Therefore, the thread will enter the terminating state only if the program ends naturally or throws an exception that is not caught.
Thread State of Java