Can you explain the lifecycle of a Java thread?

A Java thread passes through several states from creation to completion. The JVM manages these states throughout the thread's execution. Understanding the thread lifecycle is important for developing efficient and reliable multithreaded applications.

Diagram: Java thread states and transitions
Java thread states and transitions

Key Points

Thread Lifecycle States

1. New

A thread is in the New state when it has been created but has not yet started.

Example

Thread thread = new Thread();

State

NEW

Characteristics

2. Runnable

After calling start(), the thread enters the Runnable state.

Example

thread.start();

State

RUNNABLE

Characteristics

Note

In Java, Runnable includes both ready-to-run and running states.

3. Running

The thread enters the Running state when the CPU starts executing its run() method.

Characteristics

Example

public void run() {

    System.out.println(
            "Thread is running");
}

4. Blocked

A thread enters the Blocked state when it is waiting to acquire a monitor lock.

Example

Two threads trying to enter the same synchronized block.

Characteristics

5. Waiting

A thread enters the Waiting state when it waits indefinitely for another thread to perform a specific action.

Methods Causing Waiting

Characteristics

6. Timed Waiting

A thread enters the Timed Waiting state when it waits for a specified duration.

Methods Causing Timed Waiting

Example

Thread.sleep(5000);

Characteristics

7. Terminated (Dead)

A thread enters the Terminated state after completing execution or if an uncaught exception ends the thread.

Characteristics

Example

run() method completes successfully.

Thread Lifecycle Flow

NEW

|

start()

|

RUNNABLE

|

CPU Assigned

|

RUNNING

|

-----------------------------

| | |

| | |

BLOCKED WAITING TIMED_WAITING

| | |

-----------------------------

|

RUNNABLE

|

Execution Complete

|

TERMINATED

Example

Consider an online banking application.

Thread 1

Thread 2

Thread 3

Each thread may move between Runnable, Waiting, and Running states based on resource availability and execution flow.

public class Demo {

    public static void main(String[] args) {

        Thread thread = new Thread(() -> {

            System.out.println(
                    "Thread Running");
        });

        System.out.println(
                thread.getState());

        thread.start();

        System.out.println(
                thread.getState());
    }
}

Possible Output

NEW

RUNNABLE

Real-World Example

Suppose a user uploads a file

Interview Tip

A concise interview answer is

A Java thread lifecycle consists of New, Runnable, Blocked, Waiting, Timed Waiting, and Terminated states. A thread starts in the New state, moves to Runnable when start() is called, may enter Blocked or Waiting states during execution, and finally reaches the Terminated state after completing its run() method.

Last updated: 11 November 2026

Previous question: What is a thread in Java, and how do you create one?

Next question: How would you handle a scenario where two threads need to update the same data structure?

More Core Java - Level II interview questions

All Core Java - Level II questions