abstract public class Shape5
{
  private int xPos;
  private int yPos;

  public Shape5()
  {
     xPos = 0;
     yPos = 0;
  }

  public Shape5(int xPos, int yLoc)
  {
     this.xPos = xPos;
     yPos = yLoc;
  }

  public final int getX()
  {
     return xPos;
  }

  public final int getY()
  {
     return yPos;
  }

  public void moveTo(int newX, int newY)
  {
     xPos += newX;
     yPos += newY;
  }

  abstract public double getArea();

  abstract public void stretchBy(double factor);
  
  public String toString()
  {
     return "(X,Y) Position: (" + xPos + "," + yPos + ") \n";
  }

  public boolean equals(Object otherShape)
  {
    // a quick test to check if the objects are identical
    if (this == otherShape) return(true);

    // must return false if the explicit param is null
    if (otherShape == null) return(false);

    // if the classes do not match they cannot be equal
    if (getClass() != otherShape.getClass()) return(false);

    // finally, we can apply casting to check the instance members  
    Shape5 other = (Shape5) otherShape;
    return(xPos == other.xPos && yPos == other.yPos);
  }
}
