Menu
Question Index
...

What will be the output of the following program?

class MyThread extends Thread {
    public static void main(String[] args) {
        MyThread t = new MyThread();
        t.run();
    }
    public void run() {
        for (int i = 1; i < 7; ++i) {
            System.out.print(i + "..");
        }
    }
}


1..2..3..4..5..6..7..
1..2..3..4..5..6..
2..3..4..5..6..7..
2..3..4..5..6..
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