Getting an error - 'java: unreported exception java.io.FileNotFoundException; must be caught or declared to be thrown' : <p>import java.util.<em>;
import java.io.</em>;</p>

<p>public class Main {
    public static void main(String args[]){</p>

<pre><code>    int total = 0;

    File file = new File("expenditure.txt");
    Scanner fileScanner = new Scanner(file);

    while (fileScanner.hasNextLine()) {
        total += fileScanner.nextInt();
        }
        fileScanner.close();

    System.out.println("The total expenditure is " + total);
}
</code></pre>

<p>}</p>
