class demo extends
Thread {
public void run(){
for(int i=0;i<10;i++)
System.out.println(i);
}
}
class test{
public static void main(
string arg[]){
demo dt = new demo();
dt.run();
System.out.println("main thread output");
}
}
select any 1
A) Code will give compilation error on line 10, since run can not be called directly.
B) Code will compile without error, but will not show any output.
C) Code will compile without errors, but will show output unsing current Thread only
D) Code will give compilation error on line 9.
====
Answer is C
Why???, any description pls.
I selected option A, if C is correct then why we call start() method, why dont directly run() method. is this call like any other method call, and it wont register it in Thread-sceduler?
-FAF