public class Lao {
String pifu="黑黑的";
String yachi;
public Lao(){
yachi="白白的";
}
String jishu(){
return "会种小麦和大米";
}
String yule(){
return "会唱信天游";
}
}
public class Xiao extends Lao{
public Xiao() {
super();
this.pifu=super.pifu;
}
String jishu(){
return super.jishu()+"还会种菜";
}
String yule(){
return super.yule()+ "还会表演";
}
}
public class Nongmin {
public static void main(String[] args) {
Lao x=new Lao();
Xiao y=new Xiao();
x.jishu();
x.yule();
y.jishu();
y.yule();
System.out.println("程序运行结束");
}
}
老师,麻烦帮我看一下这个程序写的有问题么,为啥运行时直接输出:程序运行结束