/********************************************************** This file: RectMaker.java Author: CS302 Section 5 Date: 9-26-03 **********************************************************/ /** * The RectMaker class makes some Rectangle objects and * tests the methods of the Rectangle class. */ class RectMaker { public static void main(String[] args) { // Make four points to be corners of the rectangle. Point a = new Point(1,1); Point b = new Point(3,3); Point c = new Point(3,1); Point d = new Point(1,3); // Make a rectangle. Rectangle r1 = new Rectangle(a, c, d, b); // Make a second rectangle that’s a copy. Rectangle r2 = new Rectangle(r1); // Test the accessor method. Point p = r1.getTopLeft(); // p is (1,1) // Test the calculation methods. int width = r2.getWidth(); // width is 2 int height = r2.getHeight(); // height is 2 int area = r2.getArea(); // area is 4 } }