Multithreading:
Multithreading is one of the main features of a java programming. It enables to execute
multiple programs (process) simultaneously or concurrently.
In java a thread is a single flow of control. Multithreading means multiple flow of controls
that enables executing multiple blocks simultaneously or concurrently.
In java by default there is a main thread that is foreground thread created whenever the
main thread is created. The main thread is divided into multiple threads by starting different threads.
class ClassName
…………
…………. Single thread body execution
Benefits of Multithreading
1. Enables programmers to do multiple things at onetime
2. Programmers can divide a long program into thread and execute them in parallel which
eventually increases the speed of the program execution
3. Improved performance and concurrency
4. Simultaneously access to multiple application