This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes no such element help Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "no such element help" Watch "no such element help" New topic
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!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: no such element help
 
Similar Threads
package does not exist
Two scanner FileReader
non-static method cannot be referenced from a static context
New to java. Need help with errors.
Having troubles with a complex program, need help with an illegal start of type error.