Besides the iX and iY fields
that Shapes have,
Circles also need an iRadius field:
0288: public class Circle extends Shape // Circle.java
0289: {
0290: private int iRadius;
0291: public Circle(int pX, int pY, int pRadius) {
0292: super(pX, pY);
0293: iRadius = pRadius;
0294: }
0295: public int getRadius()
0296: {
0297: return iRadius;
0298: }
0299: public Shape translate(int pX, int pY)
0300: {
0301: return new Circle(getX() + pX, getY() + pY, iRadius);
0302: }
0303: public boolean equals(Object pObject)
0304: {
0305: return super.equals(pObject) &&
0306: iRadius==((Circle)pObject).iRadius;
0307: }
0308: public String toString()
0309: {
0310: return super.toString() + ":" + iRadius;
0311: }
0312: }