
/**
 * This program creates rectangles
 * 
 * @author pepper
 * @version 2/3/2015
 */
public class ShapeMaker
{
    /**
     * Make 2 rectangles knowing one will throw an exception. Catch it
     * 
     * @param  args   the command line arguments
     */
    public static void main (String[] args)
    {
        try 
        {
            System.out.println("I am about to create a good rectangle");
            Rectangle one = new Rectangle(3,5,2,5);
            System.out.println(one);
            System.out.println("now I am about to create a bad rectangle");
            Rectangle two = new Rectangle(3,5, -2,5);
            System.out.println("I will never even get to print this line because of the exception");
        }
        catch (IllegalArgumentException ex)
        {
            System.out.println("There was a problem and the message is: " + ex.getMessage());
        }

    }
}

