This tutorial is all about Thread States / Thread Life Cycle in Java.
In this post we will about Thread States in Java or in other terms Thread Life Cycle.
Below are the various stages in a Thread Life :
NEW : Before start() method
RUNNABLE : After start() method
BLOCKED : Whenever thread is going under deadlock
WAITING: While calling wait() method and while calling join() method
TIMED WAITING: while sleeping
TERMINATED: once execution get over or while calling stop() method
We can also verify above states by writing a simple line of code as below:
Readers might read this also: