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 is an object class?Explain its methods?

6 Answers  


Does java runtime require a license?

0 Answers  


How can we avoid including a header more than once?

0 Answers   Fidelity,


What are the steps that are followed when two computers connect through tcp?

0 Answers  


Can two objects have same hashcode?

0 Answers  


What is the purpose of nested class in java?

0 Answers  


What state does a thread enter when it terminates its processing in java programming?

0 Answers  


java program that takes a 3 digit number n and finds out whether the number 2^n + 1 is prime, or if it is not prime find out its factors.

7 Answers   HCL, Wipro,


What is the multilevel inheritance. and also give the Example of it ?

5 Answers  


What is the difference between superclass and subclass?

0 Answers  


How to sort double array in java?

0 Answers  


How does hashmap work in java ?

0 Answers  


Categories