Describe life cycle of thread.
Threads follow the single flow of control. A thread is execution in a program. The life cycles of threads are listed below:
Newborn state: After creations of Thread instance the thread is in this state though before start() method invocation. Thread is considered not alive in this stage.
Runnable state: A thread starts its life from Runnable state. After invoking of start() method thread enters Runnable state.
Running state: A thread first enters Runnable state.
Blocked state: A thread can enter in this state due to waiting the resources which are hold by another thread.
Dead state: A thread can be considered dead when its run() method completes. If any thread comes on this state which means it can't ever run again.