What is the result?

Given:


What is the result?
A. 100
210
B. Compilation fails due to an error in line n1
C. Compilation fails due to an error at line n2
D. Compilation fails due to an error at line n3

Download Printable PDF. VALID exam to help you PASS.

One thought on “What is the result?

  1. I think the answer should be D.

    Test.java produces this error:
    error: DoClass() is not public in DoClass; cannot be accessed from outside package
    DoInterface doi = new DoClass();

    This means that the DoClass() constructor has default (package private) visibility and is not visible to the Test class, which is outside package P3.

Leave a Reply

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


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