Hello friends, the code below shows an example of using filereader in java:
File.java:
import java.io.*;
class Filereader {
 public static void main(String args[]) throws IOException
 {
  FileReader f=new FileReader("File1.txt");
  BufferedReader b=new BufferedReader(f);
  String s;
  while((s=b.readLine())!=null)
   System.out.println(s);
 }
}
Have Funs.................

0 comments:

Post a Comment

Note: only a member of this blog may post a comment.