File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "no such element help" Watch "no such element help" New topic

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

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:
subject: no such element help
jQuery in Action, 3rd edition