/* FileInput.java CIS 160 David Klick 2004-09-08 Demonstrates reading data from a file. */ import java.io.BufferedReader; import java.io.FileReader; import java.io.IOException; public class FileInput { public static void main(String[] args) throws IOException { String name; double num; String msg; // opens a file that is in the same directory as this program BufferedReader in = new BufferedReader(new FileReader("fout.txt")); // read data from file name = in.readLine(); num = Double.parseDouble(in.readLine()); msg = in.readLine(); in.close(); // display what was read from file System.out.println(name); System.out.println(num); System.out.println(msg); } }