Java OCA OCP Practice Question 1305

Question

In order for a source code file, containing the public class Test, to successfully compile, which of the following must be true?

  • A. It must import java.lang.
  • B. It must declare a public class named test.
  • C. It must be named Test.java.
  • D. It must have a package statement.


C.

Note

A source code file must take the same name as any public class or interface that it declares.




PreviousNext

Related