FileReaderDemo.java Source code

Java tutorial

Introduction

Here is the source code for FileReaderDemo.java

Source

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

class FileReaderDemo {
    public static void main(String args[]) throws IOException {
        FileReader fr = new FileReader("FileReaderDemo.java");
        BufferedReader br = new BufferedReader(fr);
        String s;

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

        fr.close();
    }
}