展开全部
有点粗心了 我把我修改过的发62616964757a686964616fe58685e5aeb931333335323435给你
具体问题:是extends不是extands
类Circle拼错
Circle构造方法height拼错abstract class Shape
{
public int width,height;
public Shape(int width,int height)
{
this.width=width;
this.height=height;
}
abstract double getArea();
}
class Rectangle extends Shape
{
public double getArea()
{
return width*height;
}
public Rectangle(int width,int height)
{
super(width,height);
}
}
class Circle extends Shape
{
double r;
public double getArea()
{
return r*r*Math.PI;
}
public Circle(int width,int height)
{
super(width,height);
r=(double)width/2.0;
}
}
public class JavaApplication4
{
public static void main(String[] args)
{
Rectangle re=new Rectangle(25,25);
Circle ci=new Circle(8,4);
System.out.println(re.getArea()+ci.getArea());
}
}