MULTITHREADING

9. Create the program to create multiple threads by using Thread class

            class Th9 extends Thread {
                public void run() {
                    System.out.println("Thread : "+Thread.currentThread().getName());
                }
                public static void main(String[] args) {
                    Th9 t1 = new Th9();
                    Th9 t2 = new Th9();
                    Th9 t3 = new Th9();
                    t1.start();
                    t2.start();
                    t3.start();    
            }}
        

OUTPUT

               
    Thread : Thread-0
    Thread : Thread-1
    Thread : Thread-2