I don't know about the while() statement, but the hasNext() looks right.
Type: Posts; User: Norm
I don't know about the while() statement, but the hasNext() looks right.
The program calls the next() method on line 29 when the isn't any more data to read.
The Scanner class has a method that will test if there is more data so that the program can test for this...
Your formatting left off the [ and ]
Please edit your post and wrap your code with code tags:
YOUR CODE HERE
to get highlighting and preserve formatting.
Please explain.