class Fu {
public void show() {
System.out.println("这是父类的show方法");
}
}
class Zi extends Fu {
public void show() {
System.out.println("这是子类的show方法");
}
public void method() {
System.out.println("这是子类的method方法");
}
}
class DuoTai{
public static void main(String[] args) {
Fu f = new Zi();
f.show();
Zi z = (Zi)f;
z.method();
}
}
这个有点不明白啊,,哪位大神给解析下啊? |
|