Java concurrency (multithreading) in a nutshell
Our computers can run multiple programs or applications at the same time (for example, we can listen to music on a media player and navigate the internet at the same time). A process is an executing instance of a program or application (for example, by double-clicking on the NetBeans icon on your computer, you start a process that will run the NetBeans program). Additionally, a thread is a lightweight subprocess that represents the smallest executable unit of work of a process. A Java thread has relatively low overhead, and it shares common memory space with other threads. A process can have multiple threads with one main thread.
Important note
The main difference between processes and threads is the fact that threads share common memory space while processes don't. By sharing memory, threads shave off lots of overhead.
Concurrency is the ability of an application to handle the multiple tasks it works on. The program or...