1.

What will be the output of the program?

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

A. This code will not compile due to line 5.
B. This code will not compile due to line 6.
C. 1..2..
D. 1..2..3..
Answer» D. 1..2..3..


Discussion

No Comment Found

Related MCQs