Some thing like this:
while(input.hasNext() {
data = input.next();
// more stuff here
}
Type: Posts; User: Norm
Some thing like this:
while(input.hasNext() {
data = input.next();
// more stuff here
}
You must call hasNext() for each time that you call next(). The posted code only calls it once before the inner loop calls it 14 times.
Before calling next() you need to make sure there is data to be read. Call the hasNext method first to determine if there is anything to read. If hasNext() returns false, do not call the next()...
At line 68 the code calls the Scanner class's next() method. The method throws: NoSuchElementException
Read the API doc for a description of what that means.
Basically you need to test if there...