// read and print the first line from the input file import java.io.*; class TextInput0 { public static void main(String[] args) throws IOException { Reader filein = new FileReader("file.txt"); char ch; do { ch = (char) filein.read(); System.out.print(ch); } while ( ch!='\n' ); filein.close(); } }