Can you explain the Java thread lifecycle?



Can you explain the Java thread lifecycle?..

Answer / nashiinformaticssolutions

In Java, a thread can exist in any of the following states. The states are as follows:

New: When a new thread is first created, it is always in the new state. For a thread in the new state, the function hasn't begun to execute because it hasn't been performed yet.

Active: When a thread invokes the start() method, it moves from the new state to the active state. The active state contains both the running state and the runnable state.

Blocked or Waiting: When a thread is not active for a period of time (but not forever), it is either in the blocked state or the waiting state.

Timed waiting is what happens when we apply the sleep() technique to a certain thread.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Core Java Interview Questions

What are recursive functions? Give some examples?

0 Answers   Axtria, ITC Indian Tobacco Company,


Is it possible to write method inside method

4 Answers   L&T,


What is a boolean structure?

0 Answers  


suppose we have an interface & that interface contains five methods. if a class implements that interface then we have to bound that to give tha definition of all five methods in that class. If we declare that class as abstract then can we call only two methods to give the deinition of that method & i don't want to give the definition of all the methods? can it possible

6 Answers   HP, Wipro,


How do you escape a string?

0 Answers  






What does jenkins do?

0 Answers  


How do you ensure that n threads can access n resources without deadlock?

0 Answers  


What is meant by method overriding?

0 Answers  


What is the purpose of using javap?

0 Answers  


what are the design patterns in struts?

1 Answers  


When does a class need a virtual destructor?

0 Answers   Flextronics,


What is casting in java programming?

0 Answers  


Categories