Question: What is the output of the following program? class ThreadTest extends Thread { public void run ( ) { for ( int i = 0
What is the output of the following program?
class ThreadTest extends Thread
public void run
forint i ; i ; i
System.out.printlnA;
System.out.printlnB;
class ThreadDemo extends Thread
public void run
forint i ; i ; i
System.out.printlnC;
System.out.printlnD;
public static void mainString args
ThreadTest t new ThreadTest;
ThreadDemo t new ThreadDemo;
tstart;
tstart;
Question options:
Will print in this order ABCD...ABCD...
Will print A B C D but we cannot predict the Order in which this will be printed.
Will print in this order AB CD AB
Compile time Error There is no start method.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
