Core Java MCQ Unit 3
Core Java MCQ Unit 3
48
class Test extends Thread {
public void run()
{
System.out.println("Run");
}
Two Depend
} class Myclass { One thread No thread
49 thread upon A
public static void main(String[] args) created created
created system
{
Test t = new Test();
t.run();
}
}
class Test extends Thread {
public void run()
{
System.out.println("Run");
}
Two Depend
} class Myclass { One thread No thread
50 thread upon B
public static void main(String[] a) created created
created system
{
Test t = new Test();
t.start();
}
}
What will be output of the following
program code?
public class Test implements
Runnable
{
public void run()
{
System.out.print("go"); An
} exception is go is "gogo" is gogogo is
51 D
thrown at printed printed printed
public static void main(String arg[]) runtime.
{
Thread t = new Thread(new Test());
t.run();
t.run();
t.start();
}
}