标题: 多态[]]这题怎么输出呢 [打印本页] 作者: okchenyang44 时间: 2016-5-22 01:45 标题: 多态[]]这题怎么输出呢 class Test1_Polymorphic {
public static void main(String[] args) {
Fu f = new Zi();
//f.method();
f.show();
}
}
class Fu {
public void show() {
System.out.println("fu show");
}
}
class Zi extends Fu {
public void show() {
System.out.println("zi show");
}
public void method() {
System.out.println("zi method");
}
}