2. 以下代码运行输出是()
public class Person{
private String name=”Person”;
int age=0;
}
public class Child extends Person{
public String grade;
public static void main(String[] args){
Person p = new Child();
System.out.println(p.name);
}
}
A) 输出:Person
B) 没有输出
C) 编译出错
D) 运行出错