monica73174
asked on
Need to loop through a text file and load data into an array
I have a text file that I need to loop through and put the data into 2 seperate arrays.
For instance the data will look like this..
Mary Jones 16
How can I tell when I reach the end of the file.
This is what I have so far, I know its not much but Im still pretty new to Java.
Scanner inFile = new Scanner(new FileReader("Player.txt"));
For instance the data will look like this..
Mary Jones 16
How can I tell when I reach the end of the file.
This is what I have so far, I know its not much but Im still pretty new to Java.
Scanner inFile = new Scanner(new FileReader("Player.txt"));
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER