Threads in Java
Threads in Java
Introduction
A thread in Java is a lightweight process. It is the smallest unit of execution in a program. Java supports
multithreading, allowing multiple threads to run concurrently, improving performance and responsiveness.
System.out.println("Thread running");
Thread Lifecycle
Example
System.out.println(i);
t1.start();