Why does the Formatter(String fileName) constructor not work without handling FileNotFoundException? : <p>The constructor Formatter(String fileName) doesn't seem to compile when I don't handle FileNotFoundException even if the file already exists.</p>

<p>Here's the code that works:</p>

<pre><code>import java.util.*;

public class CreatingFiles {

public static void main(String[] args) {
    final Formatter MYFILE;

    try {
        MYFILE = new Formatter("john.txt");
        System.out.println("File created");
    }

    catch (Exception e) {
        System.out.println("Error!");
    }
  }
}
</code></pre>

<p>However when I remove the try/catch block:</p>

<pre><code>import java.util.*;

public class CreatingFiles {

public static void main(String[] args) {
    final Formatter MYFILE;

    MYFILE = new Formatter("john.txt");
  }
}
</code></pre>

<p>The compiler tells me that I have to either throw or catch the exception. So why doesn't it work without handling the exception?</p>
