title: Exception not thrown Java
body: <pre><code>class ex1
  {
      static void my() {
          System.out.println("asdsdf");
      }
  
      public static void main(String args[]) {
  
          try {
              for (;;) {
                  my();
              }
          } catch (Exception e)//Exception is not caught //Line 1
          {
              System.out.println("Overflow caught");
          } finally {
              System.out.println("In Finally");
          }
          System.out.println("After Try Catch Finally...");
  
      }
  }
  </code></pre>
  
  <p>The catch statement (Line 1) does not handle the overflow exception as such the output keeps on printing "asdsdf" without throwing an exception.
  Can anyone tell me why an infinite loop is not handled as an exception ?.
  Or that's the way it's designed and supposed to work ?</p>