/* Trivial application that displays a string */ import java.io.*; public class TrivialApplication { public static void main(String args[]) throws Exception { // Read lines of text from a file and print them BufferedReader file = new BufferedReader( new FileReader("sample.txt") ); String line = file.readLine(); while ( line != null ) { System.out.println( line ); line = file.readLine(); } file.close(); } }