/* Loops8.java CIS 160 David Klick 2004-09-20 Demonstrates priming read, reading from file */ import java.io.BufferedReader; import java.io.FileReader; import java.io.IOException; public class Loops8 { public static void main(String[] args) throws IOException { String strIn; int line = 0; BufferedReader in = new BufferedReader(new FileReader("loopdata.txt")); strIn = in.readLine(); while (strIn != null) { line++; System.out.println(line + ": " + strIn); strIn = in.readLine(); } in.close(); } }