class Point{
private int x;
private int y;

public Point(){
x = 0;
y = 0;
}

public Point(int x1,int y1){
x = x1;
y = y1;
}
public void setX(int i){
x = i;
}
public int getX(){
return x;
}
public void setY(int i){
y = i;
}
public int getY(){
return y;
}

public void display(){
System.out.println("(" + x + "," + y + ")");
}

public Point copy(Point t){
int newx = -t.getX();
int newy = -t.getY();
Point p1 = new Point(newx,newy);
return p1;
}
}
public class Test{
public static void main(String args[]){
Point m1=new Point() ;
Point m2 = new Point(30,40);
m2.display();
m1 = m2.copy(m2);
m1.display();
}
}
小弟有几个地方不明白(1)为什么要定义两个构造方法,那个无参的有什么用吗?
                    (2) 这段代码作用?(是复制Point类的结构吗)
                              public Point copy(Point t){
            int newx = -t.getX();
            int newy = -t.getY();
            Point p1 = new Point(newx,newy);
            return p1;
                  }
                     (3)程序开始执行m1 = m2.copy(m2);作用,什么意思。
谢谢!