主题:急需高手指导
下面是我编的一个程序,在运行时最后7行出现需要标识符的错误,大家给我指出哪儿错了好吗?我看了好久也没有找出来,谢谢大家了
package luo.min;
class JiangTaiBiaoMian
{
int x ,y;
viod JiangTaiBiaoMian(int x,int y)
{
this.x=x;
this.y=y;
}
static double getSquare(double a)
{
return a*a;
}
double getArea()
{
return x*y;
}
float getArea(int x,float y)
{
return x*y;
}
public double getduiJiaoXiAN()
{
return Math.sqrt(x*x+y*y);
}
}
class JiangTai
{
double height;
JiangTaiBiaoMian r;
JiangTai(JiangTaiBiaoMian r,double height)
{
this.r=r;
this.height=height;
}
protected double getTiJi()
{
return r.getArea()*height;
}
public double getArea()
{
return 2*(r.x*r.y+r.x*height+r.y*height);
}
public double getDuiJiaoXian()
{
double a=JiangTaiBiaoMian.getSqure(r.geiDuiJiaoXian);
double aa=JiangTaiBiaoMian.getSqure(height);
return Math.sqrt(a+aa);
}
}
class Test
{
public static void main(string args[]) ;
private double d,m,n;
JiangTaiBiaoMian rr=new JiangTaiBiaoMian(1,1);
JiangTai jiangtai=new JiangTai(rr,1);
d = jiangtai.getArea();
m = jiangtai.getTiJi();
n = jiangtai.getDuiJiaoXian();
system.out.println ("jiangtaibiaomian 中getArea为继承");
system.out.println ("biaomian ji : "+d);
system.out.println ("TiJi:"+m);
system.out.println ("DuiJiaoXian:"+n);
}
package luo.min;
class JiangTaiBiaoMian
{
int x ,y;
viod JiangTaiBiaoMian(int x,int y)
{
this.x=x;
this.y=y;
}
static double getSquare(double a)
{
return a*a;
}
double getArea()
{
return x*y;
}
float getArea(int x,float y)
{
return x*y;
}
public double getduiJiaoXiAN()
{
return Math.sqrt(x*x+y*y);
}
}
class JiangTai
{
double height;
JiangTaiBiaoMian r;
JiangTai(JiangTaiBiaoMian r,double height)
{
this.r=r;
this.height=height;
}
protected double getTiJi()
{
return r.getArea()*height;
}
public double getArea()
{
return 2*(r.x*r.y+r.x*height+r.y*height);
}
public double getDuiJiaoXian()
{
double a=JiangTaiBiaoMian.getSqure(r.geiDuiJiaoXian);
double aa=JiangTaiBiaoMian.getSqure(height);
return Math.sqrt(a+aa);
}
}
class Test
{
public static void main(string args[]) ;
private double d,m,n;
JiangTaiBiaoMian rr=new JiangTaiBiaoMian(1,1);
JiangTai jiangtai=new JiangTai(rr,1);
d = jiangtai.getArea();
m = jiangtai.getTiJi();
n = jiangtai.getDuiJiaoXian();
system.out.println ("jiangtaibiaomian 中getArea为继承");
system.out.println ("biaomian ji : "+d);
system.out.println ("TiJi:"+m);
system.out.println ("DuiJiaoXian:"+n);
}