public class ArrayShapes1
{
   public static void main(String[] args)
   {
     Circ[] circles = new Circ[3];         // array of 3 circles
     circles[0] = new Circ(1, 2, 3);       // creating 3 Circ objects
     circles[1] = new Circ(1, 3, 5);
     circles[2] = new Circ(5, 6, 11);

     Rect[] rectangles = new Rect[2];      // array of 2 rectangles
     rectangles[0] = new Rect(3, 5, 6, 2); // creating 2 Rect objects
     rectangles[1] = new Rect(5, 7, 2, 2);

     double totalArea = 0;                 // total area of all shapes
     for (int i=0; i<circles.length; i++)  // compute the total area of circles
       totalArea += circles[i].getArea();

     for (int i=0; i<rectangles.length; i++) // add the area of the rectangles
       totalArea += rectangles[i].getArea();

     System.out.println("Total area = " + totalArea);
   }
}
