title: when to throw FileNotFoundException
body: <p>I called a method named <code>readFile()</code> in the <code>main</code> method, <code>readFile()</code> throws FileNotFoundException but <code>main</code> doesn't, like the following:</p>
  
  <pre><code>public static void main(String[] args){
      readFile();
  }
  
  public static void readFile() throws FileNotFoundException{
      Scanner input = new Scanner(new File("file.txt"));
      ...
  }
  </code></pre>
  
  <p>When I compiled the program, I got an error at <code>readFile()</code> in the <code>main</code> method. It seems that I need to throw an exception in the header of <code>main</code> as well. Why do I need to throw exception in both headers of <code>main</code> and <code>readFile()</code>?</p>