/*
PART-B
5. Write a java program to demonstrate multithreading using runnable interface.
*/
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class program12b5 {
public static void main(String[] args) {
Thread object = new Thread(new MultiThread());
object.start();
for (int i = 0; i < 10; i++) {
System.out.println("Main Thread id: " + Thread.currentThread().getId());
}
}
}
class MultiThread implements Runnable {
@Override
public void run() {
for (int i = 0; i < 10; i++) {
System.out.println("Thread " + Thread.currentThread().getId()+ " is running");
}
}
}