The professional, friendly Java community. 21,500 members and growing!

The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.

Re: Populating multiple arrays with a File.

It appears that you're trying to read through the file twice, the first time to get the count and the second time to get the data. If so, then you will need to close the Scanner and then re-initialize it with the File between reads. You're also using the Scanner in an unsafe manner. Myself, if I check input.hasNextLine() then I follow that with input.nextLine(). Each nextXXX() should be paired with a hasNextXXX().

Re: Populating multiple arrays with a File.

[/COLOR]Thank you for your help again! I was able to fix my problem by closing the scanner, and reopening it again like you said. I am also going to take your advice about the .nextLine() and .hasNextLine()