public class Program {



	public static void main(String[] args)
	 {


	   Shape[] shapes = new Shape[5];

	   //shapes[0] =  new Shape(); 
	   //ERROR Shape is an interface


	try {
	  shapes[0] = new Circle(1);

	  shapes[1] = new Rectangle(4, 2);

	  shapes[2] = new Rectangle(3, 10);

	  shapes[3] = new Square(2);

	  shapes[4] = new Circle(4);

	}catch(DimensionException e) {

	  System.err.println("dimension error! "+ 
				e.getMessage());

	}catch(IllegalArgumentException e) {

	 System.err.println("illegal argument passed.");

	}catch(Exception e) {
	 System.err.println(e.getMessage());
	}

	

	 System.out.println("There have been "
			   + Circle.getNumCircles()
			   + " created so far.");

	// printAreas(shapes);

	}


	public static void printAreas(Shape[] shapes) {


		for(int i=0; i<shapes.length; i++)
		  System.out.println(shapes[i].area());


	}









}
