ExamVeda
Login
Home
This question belongs to Java Program Threads
Threads
?

What 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);
            }
      }
}

Answer & Solution
Correct Answer: Option D
Let's discuss the solution. Join the discussion
Examveda
Question posted by Examveda
Community

Join the Discussion

1 Comment
GUNJAN BARHAIYA
GUNJAN BARHAIYA 9 years ago
It Is Option D
not A and B because run is already defined in thread which is already extended
Not c because start() not called.