为什么一个包中的子类不能通过超类的引用访问它的超类(在另一个包中)的受保护成员?我正在努力解决这一点。请帮我
package points;
public class Point {
protected int x, y;
}
package threePoint;
import points.Point;
public class Point3d extends Point {
protected int z;
public void delta(Point p) {
p.x += this.x; // compile-time error: cannot access p.x
p.y += this.y; // compile-time error: cannot access p.y
}