Q41: What are the states in the Java Thread Lifecycle?
NEW: Thread instantiated,start()not yet called.RUNNABLE: Executing or eligible for execution in OS scheduler pool.BLOCKED: Waiting to acquire a monitor lock (synchronizedblock).WAITING: Waiting indefinitely for another thread action (Object.wait(),Thread.join()).TIMED_WAITING: Waiting for a specified time duration (Thread.sleep(ms),wait(ms)).TERMINATED: Execution completed.
Java Thread State Transitions
Key Takeaways
BLOCKED= Waiting to acquire a monitor lock.WAITING= Waiting for thread signal notification.
Knowledge Check
Which state does a thread enter when waiting to acquire a synchronized block lock held by another thread?