Java - Packages and Access Control
Given two packages
What is the error in this code?
pkg1 and pkg2, and these classes:package pkg1;
class C {
void display() {
System.out.println("Inside C");
}
}
package pkg2;
import pkg1.C;
public class D {
public static void main(String[] args) {
C c = new C();
c.display();
}
}What is the error in this code?
