public class Point {
int x;
int y;
int x0;
int y0;
public Point(int x,int y,int x0,int y0){
this.x=x;
this.y=y;
this.x0=x0;
this.y0=y0;
}
public void yidong(){
double juli=Math.sqrt(x0*x0+y0*y0);
System.out.println("移动前:x="+x+ " "+ "y="+y);
System.out.println("移动后:x="+(x+x0)+" "+ "y="+(y+y0));
System.out.println("移动距离:"+juli);
}
public static void main(String[] args) {
Point point1 =new Point(1,2,5,8);
point1.yidong();
}
}