java.lang.Thread
About
Declaration
public class Thread implements RunnableWhy Is Thread Not Abstract?
Thread t = new Thread(() -> System.out.println("Running")); t.start();public void run() { }
Constructors
Example: Creating a Thread Using Different Constructors
Thread Control Methods
1. start() and run()
2. sleep() – Pause Execution
3. join() – Wait for Another Thread to Finish
4. interrupt() – Stop a Sleeping/Waiting Thread
5. isAlive() – Check if Thread is Running
Thread Property Methods
Thread State Methods
Thread Interruption Methods
Thread Synchronization
Last updated