Which modification enables the code to compile?

Given the code fragments:

Which modification enables the code to compile?
A. Replace line n1 with: import p1.*;
Replace line n2 with: import p1. p2*;
B. Replace line n1 with: import p1.A;
Replace line n2 with: import p1.*;
C. Replace line n1 with:
import p1. A;
Replace line n2 with:
import p1. A;
import p1. p2.B;
D. Replace line n1 with:
import p1;
Replace line n2 with:
import p1;
import p1. p2;

Download Printable PDF. VALID exam to help you PASS.

2 thoughts on “Which modification enables the code to compile?

  1. C:
    but to compile you manually have to create folder p1 and copy there “A.java” file, then create p2 folder inside p1 and copy there “B.java” file. Afterwards compilation will be successful :
    # javac C.java

Leave a Reply

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


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