new BufferedReader(FileReader fileReader) : BufferedReader « java.io « Java by API






new BufferedReader(FileReader fileReader)

 
/*
 * Output:
 */

import java.io.BufferedReader;
import java.io.FileReader;

public class MainClass {

  public static void main(String args[]) {
    try {
      FileReader fr = new FileReader(args[0]);
      BufferedReader br = new BufferedReader(fr);

      String s;
      while((s = br.readLine()) != null)
        System.out.println(s);

      fr.close();
    }
    catch(Exception e) {
      System.out.println("Exception: " + e);
    }
  }
}

           
         
  








Related examples in the same category

1.new BufferedReader(Reader in)
2.new BufferedReader(InputStreamReader input)
3.BufferedReader: readLine()