What is a Thread?
Thread is a lightweight sub-process, a smallest unit of processing.
Thread Class contains run() method, which has the actual work to be performed by thread.
Life cycle of a thread
The life cycle of the thread contains following 5 stages:
4. Non-Runnable (Blocked)
The thread is in new state if you create an instance of Thread class but before the invocation of start() method.
After invocation of start() method, but the thread scheduler has not yet selected it to run.
When the thread scheduler has selected the thread, the thread is in running state .
4) Non-Runnable (Blocked)
When the thread is alive, but is currently not eligible to run, it is in blocked state
When its run() method exits the thread attains terminated or dead state