【发布时间】:2014-08-05 10:01:45
【问题描述】:
我有一个名为 Circle 的类和另一个名为 POINT 的类,因此 Circle 由半径和点(即圆的中心点)组成。我正在尝试构建一个构造函数,但遇到了一条错误消息和我无法弄清楚这个问题。
(类圈,它的开头)
public class Circle extends Shape {
private int radius, x, y;
Point point = new Point(0,0);
public Circle(radius,x, y){
this(5, 3, 6);
}
课点:
public class Point {
private int xPos,yPos;
public Point(int x, int y){
setxPos(x);
setyPos(y);
}
public int getxPos() {
return xPos;
}
public void setxPos(int xPos) {
this.xPos = xPos;
}
public int getyPos() {
return yPos;
}
public void setyPos(int yPos) {
this.yPos = yPos;
}
...
【问题讨论】:
-
究竟是什么错误信息?
-
而错误信息是...?
-
是的,很有意思:这条信息真的很清楚。
-
-令牌“,”的语法错误,删除此令牌
-
基本修复:
public Circle(int radius, int x, int y)