NoSuchElementException
when I try to read the input files?
It seems to happen right after I read the first three parts (title, author, # of notes) when I try to read the rest of the lines of the file.
What is going on?
nextLine
on your Scanner
right after reading the integer for the number of notes.
The issue is that the Scanner
's current "input cursor" position is still on the third line, at the end of the integer for # of notes, and hasn't dropped down to the next line yet where the notes will be found.
NoSuchElementException
after reading just 1 line!
I read the first line (title) successfully, but then when I try to read the second line (author), it crashes.
Why?
new Scanner(filename)
to new Scanner(new File(filename))
.
pixels[i][j]
, is i
the x-coordinate or the y-coordinate?
pixels[i][j]
refers to a pixel whose x-coordinate is j
and whose y-coordinate is i
.