MCQ Single Best Answer Not Set

QWhat is the output for the below code?
public class Test extends Thread{
      public static void main(String argv[]){
            Test t = new Test();
            t.run();
      }

      public void start(){
            for(int i = 0; i < 10; i++){
                  System.out.println("Value of i = " + i);
            }
      }
}

ID: #2310 Java thread MCQ 816 views
Question Info
#2310Q ID
Not SetDifficulty
Java thread MCQTopic

Choose the Best Option

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

  • A A compile time error indicating that no run method is defined for the Thread class
  • B A run time error indicating that no run method is defined for the Thread class
  • C Clean compile and at run time the values 0 to 9 are printed out
  • D Clean compile but no output at runtime
Correct Answer: Option D

Explanation

Clean compile but no output at runtime

Share This Question

Challenge a friend or share with your study group.