Java Topics
Thread Life Cycle
Last Updated : 26 May, 2026
title: Thread Life Cycle
title: Thread Life Cycle description: Java thread ke states aur transitions
States
1. NEW
Thread object ban gaya lekin start() nahi hua.
Thread t = new Thread(() -> System.out.println("Hello"));
// State: NEW2. RUNNABLE
start() call ho gaya. Thread scheduler queue mein hai.
t.start(); // State: RUNNABLE3. RUNNING
Thread actually CPU pe execute ho rahi hai.
4. BLOCKED
Synchronized block/method ke liye lock ka wait.
5. WAITING
wait(), join() call ke baad indefinite wait.
6. TIMED_WAITING
sleep(ms), wait(ms) — specified time ke liye wait.
7. TERMINATED
run() complete ho gaya ya exception aayi.
Thread State Check karna
Thread t = new Thread(() -> {
try { Thread.sleep(1000); }
catch (InterruptedException e) { }
});
System.out.println(t.getState()); // NEW
t.start();
System.out.println(t.getState()); // RUNNABLE or TIMED_WAITING
t.join();
System.out.println(t.getState()); // TERMINATEDThread Methods
| Method | Kaam |
|---|---|
start() | Thread start karo |
run() | Thread logic (direct call nahi karo) |
sleep(ms) | Specified time pause |
join() | Wait for thread to finish |
interrupt() | Thread interrupt karo |
isAlive() | Thread chal rahi hai? |
getName() | Thread naam |
setName() | Thread naam set karo |
getPriority() | Priority get |
setPriority() | Priority set |
Exam Focus
Revise definitions, diagrams, examples, and short-answer points for Thread Life Cycle.
Interview Use
Prepare one clear explanation, one practical example, and one common mistake for this Java topic.
Search Terms
java, java programming, core java, java master course, java notes, master, course, multithreading
Related Java Topics