Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

README.md

Day 34 - Introduction to Threads

📚 What You'll Learn Today

  • Creating threads
  • Thread lifecycle
  • sleep and join

🎯 Key Concepts

  • Thread: Unit of execution
  • Runnable: Functional interface for thread task
  • sleep/join: Control thread timing and ordering

📁 Files in This Day

  1. ThreadDemo.java - Basic thread example
  2. ExtendingThreadDemo.java - Create a thread by extending Thread
  3. RunnableThreadDemo.java - Create a thread by implementing Runnable
  4. SleepJoinDemo.java - Demonstrates sleep and join

🚀 How to Run

  1. Compile: javac *.java
  2. Run: java ThreadDemo (or any of the other classes)

💡 Exercises

  1. Create a thread using both approaches
  2. Use sleep to simulate work
  3. Use join to wait for completion

Next Day: Day 35 - Thread Synchronization