Java编译时提示找不到符号

来源:百度知道 编辑:UC知道 时间:2024/06/04 05:47:53
代码如下:
abstract class Shapes {
protected abstract double getPerimeter();
protected abstract double getArea();
}

class Rectangle extends Shapes {
private double length;
private double width;

public Rectangle(double l, double w) {
setLength(l);
setWidth(w);
}

public double getLength() { return length;}
public void setLength(double l) {
length = l>=0?l:0;
}
public double getWidth() { return width;}
public void setWidth(double w) {
width = w>=0?w:0;
}

public double getPerimeter() {
double perimeter=0;
perimeter = 2*(length+width);
return perimeter;
}

public double getArea() {
double area=0;
area = length * width;
return area;
}
}

class Point {
private int x;
private int y;

public Point(int x, int y) {
this.x = x;
t

public Circle(Point c, int d) {
center = c;
diameter = d;
}
你的这个Circle类根本就没有Circle(int,int) 这样的一个构建器
而只有一个上面的那种构建器

public Circle(Point c, int d)
大哥 你的构造方法的参数是 point 和int类型
你下面给2个整数 找得到符号才怪