title: Java fileinputstream No such file or directory
body: <p>I'm trying to learn how to use read line by line from a text file. Even though I put the txt file in the same src, the console always shows the error as - <code>No such file or directory</code>.</p>
  
  <pre><code>public class ddd {
  
  public static void main(String[] args) {
      FileInputStream fis = null;
      BufferedReader reader = null;
      try {
          fis = new FileInputStream("/dd/src/com/dd/input.txt");
          reader = new BufferedReader(new InputStreamReader(fis));
          System.out
                  .println("Reading File line by line using BufferedReader");
          String line = reader.readLine();
          while (line != null) {
              System.out.println(line);
              line = reader.readLine();
          }
      } catch (Exception e) {
          System.out.println(e.getMessage());
      } finally {
          try {
              reader.close();
              fis.close();
          } catch (IOException e) {
              System.out.println(e.getMessage());
          }
  
      }
  }
  </code></pre>
  
  <p>}<img src="https://i.stack.imgur.com/04rsJ.png" alt="enter image description here"></p>