Thread and its various states in Java

What is Thread A thread is a single sequential flow of control within a program Facility to allow multiple activities within a single process Referred as lightweight process Each thread has its own program counter, stack and local variables Threads share memory, heap area, files   Why to use Thread To perform asynchronous or background processing Increases the responsiveness of GUI applications Better utilization of system resources Simplify program logic when there are multiple independent entities A very good example of a multi-threaded application is game software where the GUI display, updating of scores, sound effects and timer display are happening within the same application simultaneously. Other Thread Advantages Threads are memory efficient. Many threads can be efficiently contained within a single EXE, while each process will incur the overhead of an entire EXE. Threads share a common program space, which among other things, means that messages can be passed… Read more“Thread and its various states in Java”