When a thread terminates its processing, into what state that thread enters?

Options
- Running state
- Waiting state
- Dead state
- Beginning state


CORRECT ANSWER : Dead state

Discussion Board
Thread state

Thread has a life cycle that it goes through everytime a method runs. The life cycle of thread is as follows:

1. New Thread
2. Runnable
3. Not Runnable
4. Dead State

The thread when in dead state the reason can only be two:
1. It is dying from natural cause
2. It has been killed or stopped by another method in the process.

A thread enters in this state when its run method exits normally. So, during the termination stage the thread becomes a part of dead state. This happens mostly in loop cases where the infinite loop runs and when the resource is full the method exits. Stop method is used to stop a thread or terminate it prematurely.

Rohit Sharma 07-28-2014 02:20 AM

java interview question

want all java programming question as i am prepare for scjp

sagar 06-27-2014 10:00 AM

Write your comments


Enter the code shown above:

(Note: If you cannot read the numbers in the above image, reload the page to generate a new one.)


Advertisement