Which statement is true?

Given the content of three files:

Which statement is true?
Which statement is true?
A. Only the A.Java file compiles successfully.
B. Only the B.java file compiles successfully.
C. Only the C.java file compiles successfully.
D. The A.Java and B.java files compile successfully.
E. The B.java and C.java files compile successfully.
F. The A.Java and C.java files compile successfully.

Download Printable PDF. VALID exam to help you PASS.

One thought on “Which statement is true?

  1. The correct answer is A.

    A.java compiles without issue.

    B.java won’t compile because the private access modifier is not allowed inside a method. The declaration
    private int x =100; inside the doStuff() method is illegal.

    C.java wont compile because package statements must appear before import statements in a .java source file.

Leave a Reply

Your email address will not be published. Required fields are marked *


The reCAPTCHA verification period has expired. Please reload the page.