/** * @author Leah Zagreus * * To change this generated comment edit the template variable "typecomment": * Window>Preferences>Java>Templates. * To enable and disable the creation of type comments go to * Window>Preferences>Java>Code Generation. */ import java.io.*; public class EchoFile { public static void main(String[] args) { String line = new String(); try { BufferedReader br = new BufferedReader(new FileReader("myFile.txt")); line = br.readLine(); while (line != null) { System.out.println(line); line = br.readLine(); } br.close(); } catch (FileNotFoundException e) { } catch (IOException e) { } } }