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

  /* "no argument constructor"
   * we'll make it the origin (0,0) */
  public Point() {
    x = 0;
    y = 0;
  }
  
  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
   *
   * we'll learn more about equals() in
   * Java soon */
  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);
  }
}
