单选题:Given code below:
Given code below:
```Java
public class main {
public void main() {
System.out.println("Hello world\n");
}
}
```
Which statement is correct? @[D](2)
A. It does not compile because “main” is used for both class and function
B. It does not compile because constructor should not have a return value
C. It compiles and prints out "Hello world"
D. It compiles but JVM will say it can not find the main() in the class
A.It does not compile because “main” is used for both class and function
B.It does not compile because constructor should not have a return value
C.It compiles and prints out "Hello world"
D.It compiles but JVM will say it can not find the main() in the class
答案:D
```Java
public class main {
public void main() {
System.out.println("Hello world\n");
}
}
```
Which statement is correct? @[D](2)
A. It does not compile because “main” is used for both class and function
B. It does not compile because constructor should not have a return value
C. It compiles and prints out "Hello world"
D. It compiles but JVM will say it can not find the main() in the class
A.It does not compile because “main” is used for both class and function
B.It does not compile because constructor should not have a return value
C.It compiles and prints out "Hello world"
D.It compiles but JVM will say it can not find the main() in the class
答案:D