import java.io.*;
public class FileInputTest {
  public static void main(String[] args) {
    try {
      String fileName = "test.txt";
      BufferedReader br = new BufferedReader(new FileReader(fileName));
      String record = null;
      while ((record = br.readLine()) != null) {
         System.out.println(record);
      }
      br.close();
    } 
    catch (Exception e) {
      System.out.println(e.getMessage());
    } 
  }
}