public static void main(String[] args) {
Father f =Son.out();
System.out.println(f.money);
}
------------------------------
class Father {
protected intmoney = 100000;
protected staticFather out() {
return new Father();
}
}
class Son extends Father {
protected intmoney = 100;
public static Sonout() {
return new Son();
}
}:
求解题过程
Father f =Son.out();
System.out.println(f.money);
}
------------------------------
class Father {
protected intmoney = 100000;
protected staticFather out() {
return new Father();
}
}
class Son extends Father {
protected intmoney = 100;
public static Sonout() {
return new Son();
}
}:
求解题过程