Multithreading vs Multitasking:
Multithreading in java is a process of executing multiple threads simultaneously.
Multitasking is a process of executing multiple tasks simultaneously.
We use multithreading than multiprocessing because threads share a common memory area so saves memory, and context-switching between the threads takes less time than process.
Source code: http://www.trainingwithliveproject.com