title: Read created at runtime file with java
body: <p>I create and write a file with a java method, then I want to read this file at runtime with another java method.But it throws java.io.FileNotFoundException error.</p>
  
  <p>How could I fix this error? </p>
  
  <pre><code>Writer output=null;
  File file = new File("train.txt");
  output = new BufferedWriter(new FileWriter(file));
  output.write(trainVal[0] + "\n");
  -------------------
  and read code
  
  FileInputStream fstreamItem = new FileInputStream("train.tx");
          DataInputStream inItem = new DataInputStream(fstreamItem);
          BufferedReader brItem = new BufferedReader(new InputStreamReader(inItem));
          String phraseItem;
          ArrayList&lt;Double&gt; qiF = new ArrayList&lt;Double&gt;();
  
          while ((phrase = br.readLine()) != null) {
              //doing somethinh here
          }
  </code></pre>