class Po
{
double i,j;
public Po(){
i=0;j=0;
}
public Po(int i,int j){
this.i=i;
this.j=j;
}
public Po(double i,double j){
this.i=i;
this.j=j;
}
};
class Pop extends Po
{
int color;
public void GivePop(double x,double y,int color){
super(x,y);
this.color=color;
}
}
public class Example13
{
public static void main(String args[]){ Pop xu=new Pop();
xu.GivePop(1.2,2.3,2);
System.out.println(xu.color);
}
};
谁能告诉我super 这句怎么错了
我用的是第一句啊!
谢谢了
超级简单的大家帮忙看看吧
{
double i,j;
public Po(){
i=0;j=0;
}
public Po(int i,int j){
this.i=i;
this.j=j;
}
public Po(double i,double j){
this.i=i;
this.j=j;
}
};
class Pop extends Po
{
int color;
public void GivePop(double x,double y,int color){
super(x,y);
this.color=color;
}
}
public class Example13
{
public static void main(String args[]){ Pop xu=new Pop();
xu.GivePop(1.2,2.3,2);
System.out.println(xu.color);
}
};
谁能告诉我super 这句怎么错了
我用的是第一句啊!
谢谢了
超级简单的大家帮忙看看吧
改为:
class Po
{
double i,j;
public Po(){
i=0;j=0;
}
public Po(int i,int j){
this.i=i;
this.j=j;
}
public Po(double i,double j){
this.i=i;
this.j=j;
}
};
class Pop extends Po
{
int color;
public Pop(double x,double y,int color){
super(x,y);
this.color=color;
}
}
public class Example13
{
public static void main(String args[]){ Pop xu=new Pop(1.2,2.3,2); System.out.println(xu.color);
}
};
So it isn't include 'color'.