public class Point {
  private int x;
  private int y;

  public Point(int initialX, int initialY) {
    x = initialX;
    y = initialY;
  }

  public void move(int dx, int dy) {
    x += dx;
    y += dy;
  }

  /* mutator method */
  public void setX(int newX) {
    x=newX;
  }

  /* mutator method */
  public void setY(int newY) {
    y = newY;
  }
  
  /* accessor method */
  public int getX() {
    return x;
  }
    
  /* accessor method */
  public int getY() {
    return y;
  }
    
  public String toString() {
    return "(" + x + "," + y + ")";
  }

  /* returns true if this point has the
   * same contents as otherPoint and
   * false otherwise
   */
  public boolean equals(Point otherPoint) {
    return x == otherPoint.x &&
        y == otherPoint.y;
  }

  /* returns a copy of this point. We'll
   * learn more about clone() in Java soon */
  public Point clone() {
    return new Point(x, y);
  }
}
