Help with this code plz

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mixmaster
    New Member
    • Nov 2006
    • 5

    Help with this code plz

    Hi When i run this code in JCreator and compile it ir comes up process complete but when i run it I get an exception in main error Why???

    import java.io.*;
    public class ReadTxtFile
    {
    public static void main(String args[]) throws Exception
    {
    BufferedReader br = new BufferedReader(
    new FileReader("tes t.txt"));
    String s;
    while (br.ready())
    {
    s=br.readLine() ;
    System.out.prin tln("The content is "+s);
    }
    }
    }
  • jariamanbarus
    New Member
    • Nov 2006
    • 3

    #2
    The destination of that code is to read the content of test.txt file.
    So, you must make a file test.txt in the same your work directory .

    Try it, u can do it...

    Comment

    • Frugoo Scape
      New Member
      • Oct 2006
      • 34

      #3
      check your
      {
      }
      i see an error with them.

      Comment

      • alj
        New Member
        • Nov 2006
        • 4

        #4
        yup.. jariamanbarus is right.. its with the test.txt..

        Comment

        Working...