Which statement is true?

Given the content of three files:Which statement is true?

Given the content of three files: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.



Leave a Reply 2

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


sil

sil

Only class A compiles successfully.
B doesn’t compile because of the private access modifier which cannot be applied to local variables.
C doesn’t compile because the import comes before the packade declaration. The correct order is package, imports, class.