class Rectangle { // the Rectangle class has 3 fields int width; int height; Point origin; // the Rectangle class has two constructors Rectangle(int width, int height, Point origin) { this.width = width; this.height = height; this.origin = origin; } Rectangle(int width, int height, int xPos, int yPos) { this(width, height, new Point(xPos, yPos)); } void setWidth(int width ) { this.width = width; } int getWidth() { return width; } void setHeight(int height ) { this.height = height; } int getHeight() { return height; } void setOrigin(Point o) { origin = o; } Point getOrigin() { return origin; } int getArea() { return width * height; } // Move rectangle origin by dx,dy void moveOrigin(int dx, int dy) { origin.setX( origin.getX() + dx ); origin.setY( origin.getY() + dy ); } }