Java Topics
Multithreading Introduction
Last Updated : 26 May, 2026
title: Thread Introduction
title: Thread Introduction description: Java mein multithreading ka introduction
Thread kya hai?
Thread ek lightweight sub-process hai — program execution ki smallest unit.
Multithreading kyun?
- Multiple tasks simultaneously karna
- CPU utilization better hoti hai
- Responsive applications banana
- Background tasks chalana
Process vs Thread
| Process | Thread | |
|---|---|---|
| -- | -- | -- |
| Memory | Alag memory space | Shared memory |
| Communication | Inter-process (slow) | Shared memory (fast) |
| Creation | Heavy, slow | Lightweight, fast |
| Example | Chrome.exe | Chrome ka har tab |
Java mein Thread create karna — 2 tarike
1. Thread class extend karna
2. Runnable interface implement karna
class MyRunnable implements Runnable {
@Override
public void run() {
System.out.println("Runnable running: " + Thread.currentThread().getName());
}
}
Thread t = new Thread(new MyRunnable());
t.start();
// Lambda se (Java 8+)
Thread t2 = new Thread(() -> System.out.println("Lambda thread"));
t2.start();main Thread
Java program main thread se start hota hai. Sabhi child threads isi se bante hain.
System.out.println(Thread.currentThread().getName()); // "main"Exam Focus
Revise definitions, diagrams, examples, and short-answer points for Multithreading Introduction.
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