class Demo8_双桨 {
public static void main(String[] args) {
DayOne d = new DayOne();
d.泡妞();
d.print();
}
}
class 双桨 {
public void sing() {
System.out.println("唱红歌");
}
public void 泡妞() {
System.out.println("唱红歌搞定林夕合鸟女士");
}
public static void print() {
System.out.println("Fu print");
}
}
class DayOne extends 双桨 {
public void 泡妞() {
System.out.println("霸王硬上弓");
}
public static void print() { //静态只能覆盖静态,其实不算重写,多态时候详细讲解
System.out.println("Zi print");
}
}
这个编译运行都没问题............啥情况啊这是 |
|