The Java thread life cycle is similar to that of the life cycle of processes that runs in an
operating system. During the life cycle, the thread shifts from one state to other based on the operation carried out by it or carried out on it. The entire life cycle of the thread is maintained by JVM. Java thread can remain one of the states given below,
1) New Born state
2) Ready / Runnable
Thread that is just instantiated is in the new state. When start () method is
invoked, thread moves to ready state from which it is moved automatically to
runnable state by thread scheduler.
A thread being executed in JVM is in the running state.
A thread which is blocked and waiting for a monitor lock is under this state. This can occur if a thread performs an input/output operation and shifts to next runnable state.
A thread which is waiting for another thread (resource) indefinitely to carry out a specific action is under this state.
A thread which is waiting for other thread to carry out an action up to a particular waiting time is under this state.
TERMINATED (dead): A thread which has exited is under this state. Once a thread entered in to this state that will never come back.