嘿,我有一个问题,运行这个应用程序,编译器显示“找不到符号”,这是指方法“SET”,有人可以帮我吗?
class Trapezoide extends Cuadrilatero {
private double p1;
private double p2;
private double p3;
private double p4;
public Trapezoide() {
}
public Trapezoide(double x, double y, double x1, double y1, double x2, double y2, double x3, double y3, double x4, double y4){
super(x, y);
setP1(x1, y1);
setP2(x2, y2);
setP3(x3, y3);
setP4(x4, y4);
}
}
答案 0 :(得分:0)
当(Java)编译器说:“找不到符号”时,基本上意味着“我找不到你刚才输入的内容”。所以检查你的“SET”方法,它不存在。
答案 1 :(得分:0)
p1,p2,p3,p4的setter不存在! :
class Trapezoide extends Cuadrilatero {
private double p1;
private double p2;
private double p3;
private double p4;
public Trapezoide() {
}
public Trapezoide(double x, double y, double x1, double y1, double x2, double y2, double x3, double y3, double x4, double y4){
super(x, y);
setP1(x1, y1);
setP2(x2, y2);
setP3(x3, y3);
setP4(x4, y4);
}
private setP1(double aX, double aY){
p1 = do_something_with_args_aX_aY;
}
private setP2(double aX, double aY){
p2 = do_something_with_args_aX_aY;
}
private setP3(double aX, double aY){
p3 = do_something_with_args_aX_aY;
}
private setP4(double aX, double aY){
p4 = do_something_with_args_aX_aY;
}
}