Java Thread Lifecycle (States)
Fast recall
Quick revision
Core answer
Whether you can name the six states and the transitions: NEW→RUNNABLE (start), RUNNABLE↔BLOCKED (lock), →WAITING/TIMED_WAITING (wait/sleep), →TERMINATED.
Confusing BLOCKED (waiting for a lock) with WAITING (waiting for notify), or thinking RUNNABLE means 'currently running' (it means ready/running/I/O).
Six states: NEW, RUNNABLE, BLOCKED, WAITING, TIMED_WAITING, TERMINATED. Know the transitions: start, lock contention, wait/sleep, notify, run() returning.
Interview-ready guide
Interview answer
A Java thread is always in exactly one of six states defined by Thread dot State.
NEW means the thread was created but start hasn't been called. RUNNABLE means start was called and the thread is ready, running, or doing I/O — the JVM combines ready and running under one label, so RUNNABLE doesn't strictly mean currently running. BLOCKED means the thread is waiting to acquire a monitor lock to enter a synchronized region.
WAITING means it's waiting indefinitely after calling wait, join, or park without a timeout. TIMED_WAITING means it's waiting for a bounded time after sleep, wait with a timeout, or join with a timeout. And TERMINATED means run has finished, normally or by exception.
The transitions are: start moves NEW to RUNNABLE; synchronized contention moves RUNNABLE to BLOCKED and back to RUNNABLE when the lock is acquired; wait, sleep, or join move to WAITING or TIMED_WAITING and notify or a timeout returns to RUNNABLE; and run returning moves to TERMINATED. The common mistake is confusing BLOCKED, which is waiting for a lock, with WAITING, which is waiting for a notify.
Java Thread Lifecycle (States)
Direct Answer
A Java thread is in one of six states defined by Thread.State: NEW (created but not started), RUNNABLE (started and ready/running, waiting for CPU or I/O), BLOCKED (waiting for a monitor lock to enter a synchronized region), WAITING (waiting indefinitely after wait()/join()/LockSupport.park()), TIMED_WAITING (waiting for a bounded time after sleep(ms)/wait(ms)/join(ms)), and TERMINATED (run() finished). It moves between them via start() (NEW→RUNNABLE), synchronized contention (RUNNABLE→BLOCKED), wait()/sleep()/join() (→WAITING/TIMED_WAITING), notify()/timeout/return (→RUNNABLE), and run() returning (→TERMINATED).
Code Example
Thread t = new Thread(() -> { /* task */ }); // NEW
System.out.println(t.getState()); // NEW
t.start(); // -> RUNNABLE
System.out.println(t.getState()); // RUNNABLE
// Inside the task, contention/wait move the state:
synchronized (lock) { // if lock held: BLOCKED
lock.wait(); // -> WAITING (until notify)
}
Thread.sleep(500); // -> TIMED_WAITING (500ms)
// When run() returns -> TERMINATED
t.join();
System.out.println(t.getState()); // TERMINATED
Common Mistakes & Pitfalls
- Confusing BLOCKED (waiting for a lock) with WAITING (waiting for notify) — different causes.
- Thinking RUNNABLE means 'currently running' — it means ready, running, or doing I/O.
- Forgetting that sleep() puts a thread in TIMED_WAITING, not WAITING.
Check your understanding
Answer these without looking back at the article.
- What are the six thread states, and what does each mean?
- How does a thread move from NEW to RUNNABLE, and to TERMINATED?
- What's the difference between BLOCKED and WAITING (lock vs notify)?
- Why doesn't RUNNABLE mean 'currently running' (ready/running/I/O)?
Looking for a structured roadmap?
Every module on this page is also part of the full Java backend interview track.