title: Issue with FileOutputStream in Java
body: <p>I get a runtime exception when I execute the following code. I cannot see what is wrong.</p>
  
  <pre><code>import java.io.File;
  import java.io.FileOutputStream;
  import java.io.PrintWriter;
  
  public class FileIO {
  
      public static void main(String[] args){
  
          File test = new File("test.txt");
  
          FileOutputStream ostream = new FileOutputStream(test); 
  
          PrintWriter out = new PrintWriter(ostream);
      }
  }
  </code></pre>
  
  <p>I keep getting a <code>FileNotFoundException</code>. I have tried keeping the file in every possible folder within the project and also tried giving an explicit path, but I keep getting the same exception. Any ideas?</p>