あるパッケージのサブクラスが、スーパークラスの参照によって (別のパッケージの) スーパークラスの保護されたメンバーにアクセスできないのはなぜですか? この点で苦労しています。私を助けてください
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
}