package test;
public class test {
private String baseName = "base";
public test() {
callName();
}
public void callName() {
System.out.println(baseName);
}
static class Sub extends test {
private String baseName = "sub";
public void callName() {
System.out.println(baseName);
}
}
public static void main(String[] args) {
test bb = new Sub();
}
}
为什么输出结果为 null?
MMMHUHU
相关分类