public class Test extends Father{
private String name=”test”;
public static void main(String[] args){
Test test = new Test();
System.out.println(test.getName());
}
}
class Father{
private String name=”father”;
public String getName() {
return name;
}
}为什么结果是father而不是test?