<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">/**
 * This class is designed to illustrate the use of the Point and PointDisplay
 * classes.
 * 
 * @author Nathan Sprague
 * @version 9/7/15
 * 
 */
public class PointDemo
{

    /**
     * Create several points and apply illustrate how they may be processed and
     * displayed.
     * 
     * @param args not used.
     */
    public static void main(String[] args)
    {

        Point[] points = new Point[4];
        double tmp;
        
        points[0] = new Point(5, 5);
        points[1] = new Point(5, 150);
        points[2] = new Point(50, 5);
        points[3] = new Point(50, 150);

        new PointDisplay(points, "Points on a rectangle!");

        // Now swap all x and y coordinates
        for (int i = 0; i &lt; points.length; i++)
        {
            tmp = points[i].getX();
            points[i].setX(points[i].getY());
            points[i].setY(tmp);

        }
        new PointDisplay(points, "Flipped rectangle!");

    }

}
</pre></body></html>