/** * instructor: Ray Ortigas * Date: Summer 2000 * http://www.dgp.toronto.edu/~rayo/tutorials/108/2000summer/ */ // A shape. abstract public class Shape { // The x-coordinate of this shape. public int x = 0; // The y-coordinate of this shape. public int y = 0; // Returns the area of this shape. abstract public int getArea(); // Moves this shape by 'dx' and 'dy'. public void move(int dx, int dy) { x += dx; y += dy; } // Returns a string representation of this shape. public String toString() { return "x = " + x + "; y = " + y; } }