class JianBingManTest{
public static void main(String[] args){
Fu p = new JianBingMan();
System.out.println("我说这是谁啊");
System.out.println("O(∩_∩)O~,是我"+p.name);
System.out.println("大鹏,你在做什么呢?");
System.out.println(p.name+":原来我不是看手相嘛,被举报之后,城管把我摊子砸了,我没法做了/(ㄒoㄒ)/~~~~~");
System.out.print(p.name+":现在我拍电影挣钱呢.");
p.business();
System.out.println("help!!");
JianBingMan man = (JianBingMan) p;
man.fly();
man.savePeople();
}
}
class Fu{
String name = "大鹏";
public void business(){
System.out.println("看手相");
}
}
class JianBingMan extends Fu{
String name = "煎饼侠";
public void business(){
System.out.println("合影一次10元,拯救地球不要钱");
}
public void fly(){
System.out.println(name+":我要飞起来,小龙侠、小品侠推我一把");
}
public void savePeople(){
System.out.println(name+":菇凉,不要怕,我来救你了");
}
}
怎么才能使p.business()输出“看手相”?System.out.println(p.name+":原来我不是"+????+"嘛,被举报之后,城管把我摊子砸了,我没法做了/(ㄒoㄒ)/~~~~~");
"????"之间想调用父类中的 business()
|
|