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

Difference between start() and run() method of thread class?

0 Answers  


Name the package that most of the AWT events that supports event-delegation model are defined?

2 Answers  


Why is whitespace important?

0 Answers  


Why are the destructors for base class and derived class called in reverse order when the program exits

0 Answers   HCL,


Explain the difference between scrollbar and scrollpane?

1 Answers  


why using interface interface ?

0 Answers  


what is the J2EE BluPrints?

0 Answers  


What is a parameter example?

0 Answers  


Explain Event handling in AWT?

1 Answers   Infosys, TCS,


Is &&= a valid Java operator?

2 Answers  


what do you mean by java annotations?

0 Answers  


What is comparable and comparator interface? List their differences

0 Answers  


Categories