Q:

What is the result?

0

What is the result?

public class MyThread implements Runnable
{
public void run()
{
System.out.println("running");
}
public static void main(String args[])
{
Thread t= new Thread(new MyThread());
t.run();
t.run();
t.start();
}
}

  1. Compilation fails
  2. An Exception is thrown at runtime
  3. The code executes and prints \"running\"
  4. The code executes and prints \"runningrunning\"
  5. The code executes and prints \"runningrunningrunning\"

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

Correct Answer:

The code executes and prints "runningrunningrunning"

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

This question belongs to these collections

Similar questions


need a help?


find thousands of online teachers now