Menu
Question Index
...

What will be the output of the following program?

class T implements Runnable {
    public void run() {
        System.out.print("Output Display~");
    }
}
public class TClass {
    public static void main(String args[]) throws Exception {
        Thread thread1 = new Thread();
        Thread thread2 = new Thread(new T());
        Thread thread3 = new Thread(new T(), "Thread3");
        Thread thread4 = new Thread("Thread4");
        thread1.run();    thread2.run();
        thread3.run();    thread4.run();
    }
}


Output Display~Output Display~
Output Display~Output Display~Output Display~
Output Display~Output Display~Output Display~Output Display~
Some other output
Compilation Error or Runtime Error

Doubts

Problems

Topic: What is Multitasking and Multithreading?

Read this topic
Take test on this topic

0
Wrong
Score more than 2 points

© meritcampus 2019

All Rights Reserved.

Open In App