单选题:What will happen when you attempt to compile and run this code?
What will happen when you attempt to compile and run this code?@[D](2)
```Java
public class MyMain{
public static void main(String argv){
System.out.println("Hello cruel world");
}
}
```
A. The compiler will complain that main is a reserved word and cannot be used for a class
B. The code will compile and when run will print out "Hello cruel world"
C. The code will compile but will complain at run time that no constructor is defined
D. The code will compile but will complain at run time that main is not correctly defined
A.The compiler will complain that main is a reserved word and cannot be used for a class
B.The code will compile and when run will print out "Hello cruel world"
C.The code will compile but will complain at run time that no constructor is defined
D.The code will compile but will complain at run time that main is not correctly defined
答案:D
```Java
public class MyMain{
public static void main(String argv){
System.out.println("Hello cruel world");
}
}
```
A. The compiler will complain that main is a reserved word and cannot be used for a class
B. The code will compile and when run will print out "Hello cruel world"
C. The code will compile but will complain at run time that no constructor is defined
D. The code will compile but will complain at run time that main is not correctly defined
A.The compiler will complain that main is a reserved word and cannot be used for a class
B.The code will compile and when run will print out "Hello cruel world"
C.The code will compile but will complain at run time that no constructor is defined
D.The code will compile but will complain at run time that main is not correctly defined
答案:D