Reading Text from a File

try { BufferedReader in = new BufferedReader(new FileReader("infilename")); String str; while ((str = in.readLine()) != null) { process(str); } in.close(); } catch (IOException e) { }

Comments

14 Jan 2010 - 10:55pm by Anonymous (not verified)

good example.

14 Jan 2010 - 10:57pm by jojo (not verified)

It is really nice that I knew buffered reader.

29 Jan 2010 - 1:41am by Balu (not verified)

Simple and good example.

3 Feb 2010 - 10:22pm by Abbee (not verified)

I need more help with this.

4 Feb 2010 - 12:51pm by Anonymous (not verified)

thanks exactly what i needed

Post a comment

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Enter the characters shown in the image. Ignore spaces and be careful about upper and lower case.