try {
FileReader read = new FileReader("namesToReadIn.txt");
BufferedReader readIn = new BufferedReader(read);
String line = ""; String total = "";
while((line = readIn.readLine()) != null)
{ System.out.println(line);
total += line;
}
String [] allTheNames = total.split(",");
System.out.println("There were " + allTheNames.length + " names read in"); } catch (IOException e)
{ System.out.println(e); }
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment