import java.io.*;

public class FileAccess {
  
  /**
   * Read each line of a file and display the 
   * contents on the screen.
   */ 
  public static void displayFile(String filename) throws IOException {
    FileReader f = new FileReader(filename);
    BufferedReader br = new BufferedReader(f);

    // read the first line
    String temp = br.readLine();
    
    // if the line read is null, we finished reading the file
    while(temp != null) {
      System.out.println(temp);  // print the line
      temp = br.readLine();
    }
    

    // after we are done, we should close the BufferedReader and the file.
    br.close();
    f.close();
  }
}