单选题:What will happen when you attempt to compile and run the followi
What will happen when you attempt to compile and run the following code?
```Java
public class Bground extends Thread{
public static void main(String argv[]){
Bground b = new Bground();
b.run();
}
public void start(){
for (int i = 0; i <10; i++){
System.out.println("Value of i = " + i);
}
}
}
```
@[D](2)
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
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
答案:D
```Java
public class Bground extends Thread{
public static void main(String argv[]){
Bground b = new Bground();
b.run();
}
public void start(){
for (int i = 0; i <10; i++){
System.out.println("Value of i = " + i);
}
}
}
```
@[D](2)
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
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
答案:D