Life Cycle of Thread
Answers were Sorted based on User's Feedback
Answer / guru
When an object is created using Thread class,it is in the
new state, when the start method is called the object goes
into the runnable state from where the scheduler picks up
and starts executing. If that process requires any resource
it is picked and put to the blocked state and when the
process finished that thread is in dead state.
states:
1 new
2 runnable
3 running
4 blocked
5 dead
| Is This Answer Correct ? | 15 Yes | 1 No |
Answer / gajendra
A Thread has the following life cycles states
1.New/Born state:When a thread is just instantiated we say
that the thread is in born state.now it can not compete for
CPU cycles.
2.Active state:When we call the start() on thread object a
thread moves from born state to active state.Here the code
associated with run() will be executed.
3.Blocked state:When the thread is temporarily keep out of
ready queue,we say that the thread is in blocked state. In
this state it can't compete for CPU cycles.
4.Dead state:When the thread execution is completed or
forcibly terminate the thread, it will be moved to dead
state.
| Is This Answer Correct ? | 7 Yes | 2 No |
Answer / deepak divvela
1.ActiveState
2.RunnableState
3.RunningState
4.Blocked State
5.Dead State
These are the Thread Life Cycle States
| Is This Answer Correct ? | 2 Yes | 1 No |
How do you compare two strings? any predefined method for this?
What are different types of arrays?
give an example for encapsulation?
What is the difference between access specifiers and access modifiers in java? 16
as we know a static method could access static data and static method only. then how could main method call the object of aclass which is not static and other non static data
What is dynamic binding?
How do you sort words in java?
What is the common usage of serialization? What exceptions occur during serialization?
What is a short in java?
What access modifiers can be used for class ?
What is the purpose of using bufferedinputstream and bufferedoutputstream classes?
Write a program to show whether a graph is a tree or not using adjacency matrix.