Java Threads and Shared Variables?

What is the life cycle of a Java thread in terms of its states and what are the operations and events that cause transitions between these states?

Asked by Ben Lewell on November 28th, 2011 @ 8:30 p.m.
Sign in to answer this question

1 answer to this question

The most relevant answers filter to the top...

Life cycles of Java thread. Life cycle states are 'new' 'runable' 'not runable' and 'dead'.

A thread can bounce between 'runable' and 'not runable' states as a result of scheduling or programmer control.

The new thread will start executing if you use the 'start' command.
The scheduler changes the states of the thread to 'runable. The state is changed to 'not runable' when its using a sleep command or wait command or its blocked on an input output disc.

The 4th state = the thread becomes 'dead' when the method completes.
Answered by Matt Cicarello on January 19th, 2012 @ 11:52 a.m.