    class CallWithException 
      { 
      public static void main (String args[]) 
        {
        int i;

        for (i = 0; i < 3; i++)
          {
          try
            {
            System.out.println ("Iteration = " + i);
            Thread.sleep (1000);
            }
          catch (Exception e)
            {
            System.out.println ("An exception occurred: " + e);
            }
          }
        System.out.println ("Done!");
        } 
      } 

