Sail E0 Webinar
Question
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); } }}
Options:
A .  None of these
B .  A run time error indicating that no run method is defined for the Thread class
C .  Clean compile but no output at runtime
D .  A compile time error indicating that no run method is defined for the Thread class
E .  Clean compile and at run time the values 0 to 9 are printed out
Answer: Option C

Submit Your Solution Below and Earn Points !
Next Question

Submit Solution

Your email address will not be published. Required fields are marked *

Latest Videos

Latest Test Papers