abstract class fig{
int x,y;
abstract int area();
fig(int a,int b){
x=a;
y=b;
}
}class rect extends fig{
fig(int a,int b){
super(a,b);
}
int area(){
return x*y; //<<====x和y不是本类的对象,怎么可以直接用啊
}
}
int x,y;
abstract int area();
fig(int a,int b){
x=a;
y=b;
}
}class rect extends fig{
fig(int a,int b){
super(a,b);
}
int area(){
return x*y; //<<====x和y不是本类的对象,怎么可以直接用啊
}
}
super().y
super();自然得到父类。
没有说明你是随母姓,
说出你的名字,前面自然是你父亲的姓氏.