1.

What is the output of this program?
class N extends Thread
{
Thread thread;
String Str;
N(String ThreadName)
{
Str = ThreadName;
thread = new Thread(this,Str);
thread.start();
}
public void run()
{
}

}

public class multithreading_Example
{
public static void main(String args[])
{
N object1 = new N("First");
N object2 = new N("Second");
try
{
object1.thread.wait();
System.out.print(object1.thread.isAlive());
}
catch(Exception e)
{
System.out.print("Running Main Thread...");
}
}
}

A. First
B. Second
C. Running Main Thread...
D. All of above
E. None of these
Answer» D. All of above


Discussion

No Comment Found

Related MCQs