1.

What will be the output of the program?
 class s1 extends Thread { public void run() { for(int i = 0; i < 3; i++) { System.out.println("A"); System.out.println("B"); } } } class Test120 extends Thread { public void run() { for(int i = 0; i < 3; i++) { System.out.println("C"); System.out.println("D"); } } public static void main(String args[]) { s1 t1 = new s1(); Test120 t2 = new Test120(); t1.start(); t2.start(); } } 

A. Compile time Error There is no start() method
B. Will print in this order AB CD AB...
C. Will print but not be able to predict the Order
D. Will print in this order ABCD...ABCD...
Answer» D. Will print in this order ABCD...ABCD...


Discussion

No Comment Found