Programming Language Java thread MCQ Question #2311
Single Choice Not Set

QWhat will be the output of the following program code?
public class Test implements Runnable{
      public void run(){
            System.out.print("go");
      }
    
      public static void main(String arg[]) {
            Thread t = new Thread(new Test());
            t.run();
            t.run();
            t.start();
      }
}

ID: #2311 Java thread MCQ 688 views
Question Info
#2311Q ID
Not SetDifficulty
Java thread MCQTopic

Choose the Best Option

Click any option to instantly check if you're correct.

  • A Compilation fails.
  • B An exception is thrown at runtime.
  • C "go" is printed
  • D "gogogo" is printed
Correct Answer

Explanation

"gogogo" is printed

Share This Question

Challenge a friend or share with your study group.