Heim > Fragen und Antworten > Hauptteil
public class A { private String C; public A(String word) { this.C=word; } } public class B extends A{ public B(String word) { super(word); } public static void main(String[] args) { new B("C"); } }
我想问this指向的是B对象,为什么能访问父类的private C字段