title: checking files as command line arguments in java
body: <p>I'm trying to pass in a text file(input and output files) as the command line arguments inside a <code>try-catch</code> block.</p>
  
  <p>This is a snippet of the code:</p>
  
  <pre><code>try {
      PrintWriter outFile = new PrintWriter(new FileOutputStream(args[0]));
  } catch (FileNotFoundException exc) {
      System.out.println("file does not exist");
  } catch (Exception e) {
      System.out.println("general exception");
  }
  </code></pre>
  
  <p>I'm trying to check it by passing a file that doesn't exist but it doesn't seem to work, not even in the general exception. I tried <code>printStream</code> as well but nothing really changed.</p>
  
  <p>Any help would be appreciated, thanks!</p>