import java.io.*; public class TestThis { public void printFiletoConsole(FileReader read) throws IOException { BufferedReader br = new BufferedReader(read); String string; while((string = br.readLine()) != null) { System.out.println(string); } } public static void main(String args[])throws IOException{ TestThis ts = new TestThis(); FileReader fr = new FileReader("hello.txt"); ts.printFiletoConsole(fr); } }