Basic Concepts of Threading
Thread: A thread is the smallest unit of execution within a program. Each thread has its own stack, program counter, and local variables.
Main Thread: When a Java application starts, the main method is executed by the main thread. You can create additional threads to perform tasks concurrently.
Creating Threads: There are two main ways to create a thread in Java:
Extending Thread class.
Implementing Runnable interface.