我为它输入的代码如下:
class MyPoint {
public int x;
public int y;
public MyPoint(){
x = 0;
y = 0;
}
public MyPoint(int x, int y) {
this.x = x;
this.y = y;
}
public void setXY(int newx, int newy) {
x = newx;
y = newy;
}
public int[] getXY() {
int [] getXYarray = new int[2];
getXYarray[0] = x;
getXYarray[1] = y;
return getXYarray;
}
public String toString() {
return "(" + x + "," + y + ")";
}
但我看不出这里到底有什么问题。
请告诉我我哪里出错了,因为我很迷茫。
慕哥9229398
相关分类