public class Rectangle extends Shape { private int iWidth; private int iHeight; public Rectangle(int pWidth, int pHeight, int pX, int pY) { super(pX, pY); iWidth = pWidth; iHeight = pHeight; } public int getWidth() { return iWidth; } public int getHeight() { return iHeight; } @Override public Rectangle translate(int pX, int pY) { return new Rectangle(iWidth, iHeight, getX() + pX, getY() + pY); } public @Override boolean equals(Object pObject) { return super.equals(pObject) && iWidth==((Rectangle)pObject).iWidth && iHeight==((Rectangle)pObject).iHeight; } @Override public String toString() { return super.toString() + ":" + iWidth + ":" + iHeight; } }