Java - Packages and Access Control
Examine the code below:
What is the issue with this code?
package pkgA;
public class Base {
protected String message = "Hello";
}
package pkgB;
import pkgA.Base;
public class Demo {
public static void main(String[] args) {
Base b = new Base();
System.out.println(b.message);
}
}What is the issue with this code?
