| Author |
no such element help
|
Dustin Schreader
Ranch Hand
Joined: May 25, 2009
Posts: 74
|
|
I'm having trouble figuring out what I'm doing wrong that I'm getting the error no line found. Here is my code. I'm having the problem on line 120 and 19
|
 |
Ralph Cook
Ranch Hand
Joined: May 29, 2005
Posts: 479
|
|
|
well, at a quick guess, there are no more lines in the file you're reading...
|
 |
John Jai
Bartender
Joined: May 31, 2011
Posts: 1776
|
|
Before reading next line of the Scanner, check whether they exist using hasNextLine() method. So all your below nextLine() should have a hasNextLine() check and the nextInt() should have hasNextInt() check.
|
 |
Dustin Schreader
Ranch Hand
Joined: May 25, 2009
Posts: 102
|
|
|
Thank you that helped!
|
 |
 |
|
|
subject: no such element help
|
|
|