Having trouble reading from a file
<p>I have a more complex program that involves using what's written in a text file but it wasn't working at all, nothing was being displayed and everything is dependent on the file. If i just make the string equal to something in my code and get rid of reading from the file then it works. I tried something as simple as displaying the line that is read but it doesn't display anything when i run it.</p>

<p>Edit: It can't find the path to the file... where is the default file usually in? The file is in the same directory as the program but it can't find it, why?</p>

<pre><code>public static void main(String[] args) {
    String s;
        try {
            FileReader fstream=new FileReader("input.txt");
            BufferedReader in=new BufferedReader(fstream);

        while((s=in.readLine())!=null){
        System.out.print(s);


        }}catch(IOException e){
            System.exit(0);
        }
    }
}
</code></pre>
