title: Will a java exception terminate the whole java application?
body: <p>I used to think that when an exception happened, the whole java application will be terminated. For example, I write a test function to test my idea.</p>
  
  <pre><code>public void test(){
      File fileDir=new File(sourceDataDir);
      if(fileDir.exists()){
          File[] files = fileDir.listFiles();
          for(int index=0 ; index&lt;files.length ; index++){
              System.out.println("index = "+index);
              File file = files[index];
              if(index == 1)//delete a file to cause a FileNotFoundException
                  file.delete();
              try {
                  BufferedReader in = new BufferedReader(new FileReader(file));
              } catch (FileNotFoundException e) {
                  e.printStackTrace();
              }
          }
      }
  }
  </code></pre>
  
  <p>I delete a file to cause a <code>FileNotFoundException</code> manually. I used to think that the whole application will terminate when the  exception happened. But in fact, the application will continue reading the remaining files. So, my question is, in what condition an exception will cause the whole application to be terminated?</p>