try to end a program if file no found
<p>I am trying to terminate a program if the if statement returns that the file does not exist. At the moment the method is </p>

<pre><code>public static void calcMarks() 
  {
      String Assessment1 = null, Assessment2 = null, Assessment3 = null;
      int mark1 = 0,mark2 = 0,mark3 = 0,sum = 0;
       try {
       File doc = new File ("marks.txt");
       if(!doc.exists())
       {
        System.out.println ("Marks.txt Does Not Exist");
        System.exit(); 
       }
       if(!marks.exists())
       {
         System.out.println ("TotalMarks.txt Does Not Exist");
         System.exit(); 
       }
       Scanner input = new Scanner(doc);
         while (input.hasNext()){
          Assessment1 = input.next();
          mark1 = input.nextInt();
          Assessment2 = input.next();
          mark2 = input.nextInt();
          Assessment3 = input.next();
          mark3 = input.nextInt();

        }  
      input.close();
      sum = mark1 + mark2 + mark3;
      System.out.println(Assessment1 + " "  +mark1  +"\n"+  Assessment2  + " "+mark2 +"\n"+  Assessment3  + " "+mark3+ "\n" + "Total" +""+ "=" + sum);
    }
    catch (FileNotFoundException ex) {
      System.err.println("File has not been found");
    } 

     }
</code></pre>

<p>but on the System.exit(); is the if statement, I get the error exit(int) in Jaba.lang.system. cannot be applied to ()</p>

<p>I have no idea what that means </p>
