Return to site

JAVA CERTIFICATION QUESTION: Implicit and explicit variable context in Java

· java,ocp

To properly address any variable, the Java compiler needs to be able to unambiguously determine the context in which it exists.


Given the following classes:

Which of the following lines, added independently at line n1, will make the code compile successfully? Choose two.


A. result = 0;

B. this.result = 0;

C. super.result = 0;

D. new Test().result = 0;

E. new CodeTest().result = 0;




·Ǝ puɐ ꓷ ǝɹɐ suoᴉʇdo ʇɔǝɹɹoɔ ǝɥꓕ ·uoᴉsnๅɔuoꓛ