class Demo8_双桨 {
public static void main(String[] args) {
DayOne d = new DayOne();
d.泡妞();
d.print();
TianYi t = new TianYi();
t.泡妞();
t.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");
}
}
class TianYi extends 双桨 {