Return to site

JAVA CERTIFICATION QUESTION: Define the structure of a Java class

· java,ocp

Test your knowledge of Java classes, such as their valid names, the use of variables inside a method, and the number of import statements.

Which of the following statements are correct about a Java class? Choose two.

A) A Java class must have a name shown in the source code.

B) A Java class may have several local variables with the same name inside the same method.

C) A Java class may have several import statements.

D) An underscore character ("_") is a valid Java class name.

 

The answer is B & C