/* Array2.java CIS 160 David Klick 2004-11-01 Reading array data from a file and dealing with partially filled arrays. */ import java.io.BufferedReader; import java.io.FileReader; import java.io.IOException; public class Array2 { public static void main(String[] args) throws IOException { BufferedReader in = new BufferedReader(new FileReader("people.txt")); final int MAXSIZE = 100; int numRecs = 0; String[] names = new String[MAXSIZE]; String s; s = in.readLine(); while (s != null) { if (numRecs < MAXSIZE) { names[numRecs++] = s; } else { System.out.println("Error: Too many records in file"); break; } s = in.readLine(); } in.close(); for (int i=0; i