Google News
logo
Java Multithreading - Interview Questions
What are the states in the lifecycle of a Thread?
A thread can have one of the following states during its lifetime :
 
New : In this state, a Thread class object is created using a new operator, but the thread is not alive. Thread doesn't start until we call the start() method.
Runnable : In this state, the thread is ready to run after calling the start() method. However, the thread is not yet selected by the thread scheduler.
Running : In this state, the thread scheduler picks the thread from the ready state, and the thread is running.
Waiting/Blocked : In this state, a thread is not running but still alive, or it is waiting for the other thread to finish.
Dead/Terminated : A thread is in terminated or dead state when the run() method exits.
Advertisement