Embed presentation
Download to read offline


![Program
package quipoin;
class Demo extends Thread {
public void run() {
System.out.println("Thread is running!!");
}
public static void main(String args[]) {
Demo t1 = new Demo(); t1.start();
}
}](https://image.slidesharecdn.com/multitasking-231125050529-d5ff08f4/75/Multitasking-pptx-3-2048.jpg)

Multitasking in Java allows for the simultaneous execution of multiple tasks through two types: process-based and thread-based multitasking. Process-based multitasking involves heavyweight processes with high communication costs and separate memory allocation, while thread-based multitasking uses lightweight threads that share memory, reducing costs and allowing independence among threads. The document also includes a sample code demonstrating thread creation in Java.


![Program
package quipoin;
class Demo extends Thread {
public void run() {
System.out.println("Thread is running!!");
}
public static void main(String args[]) {
Demo t1 = new Demo(); t1.start();
}
}](https://image.slidesharecdn.com/multitasking-231125050529-d5ff08f4/75/Multitasking-pptx-3-2048.jpg)
