Thrown by Iterator.next(), Scanner.next(), and similar methods when there are no more elements. Always check hasNext() before calling next().
NoSuchElementException
java Thrown by Iterator.next(), Scanner.next(), and similar methods when there are no more elements. Always check hasNext() before calling next().