单选题:Given code below:
Given code below:
```Java
public class My {}
```
Which statement below is correct? @[A](2)
A. It has to be in a file named My.java.
B. It has to be in a directory named My.
C. It can be in any file without any other class definition in the same file.
D. It can be in any file with other class definitions in the same file.
A.It has to be in a file named My.java.
B.It has to be in a directory named My.
C.It can be in any file without any other class definition in the same file.
D.It can be in any file with other class definitions in the same file.
答案:A
```Java
public class My {}
```
Which statement below is correct? @[A](2)
A. It has to be in a file named My.java.
B. It has to be in a directory named My.
C. It can be in any file without any other class definition in the same file.
D. It can be in any file with other class definitions in the same file.
A.It has to be in a file named My.java.
B.It has to be in a directory named My.
C.It can be in any file without any other class definition in the same file.
D.It can be in any file with other class definitions in the same file.
答案:A