/* FileInput2.java CIS 160 David Klick 2010-09-15 Demonstrates reading data from a file. */ import java.io.File; import java.io.IOException; import java.util.Scanner; public class FileInput2 { public static void main(String[] args) throws IOException { String name; double num; String msg; Scanner in = new Scanner(new File("fout.txt")); while (in.hasNextLine()) { name = in.nextLine(); num = in.nextDouble(); in.nextLine(); msg = in.nextLine(); // display what was read from file System.out.println(name); System.out.println(num); System.out.println(msg); } in.close(); } }