Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - Java programming, create a class point, with member variables x and y, all of which are int types.
Java programming, create a class point, with member variables x and y, all of which are int types.
Common class point {

Private int x;;

Private int y;;

public void setX(int x) {

this.x = x

}

Common empty set (int y) (

this.y = y

}

Common point () {

this . x = 0;

this . y = 0;

}

Common point getPoint() {

Return this;

}

public void movePoint(int x,int y) {

this.x = x

this.y = y

}

Common string toString() {

return "[X=" + x +",Y = "+Y+"]";

}

Public static void main(String[] args) {

Point Point = new Point();

system . out . println(point);

point . setx(5);

point . sety(5);

system . out . println(point . get point());

point.movePoint( 10,20);

system . out . println(point);

}

}