The thread life cycle in Java.

Thread has the following states:

New
Runnable
Running
Non-runnable (Blocked)
Terminated
Thread Life Cycle in JAVA

New: In New state, a Thread instance has been created but start () method is not yet invoked. Now the thread is not considered alive.
Runnable: The Thread is in the runnable state after the invocation of the start () method, but before the run () method is invoked. But a thread can also return to the runnable state from waiting/sleeping. In this state, the thread is considered alive.
Running: The thread is in a running state after it calls the run () method. Now the thread begins the execution.
Non-Runnable(Blocked): The thread is alive but it is not eligible to run. It is not in the runnable state but also, it will return to the runnable state after some time. Example: wait, sleep, block.
Terminated: Once the run method is completed then it is terminated. Now the thread is not alive.
Posted on by