java · java/NoSuchElementException
NoSuchElementException
NoSuchElementException
Thrown by Iterator.next(), Scanner.next(), and similar methods when there are no more elements. Always check hasNext() before calling next().
Also defined in
- kotlin NoSuchElementException Thrown when a collection or iterator is accessed for an element that does not exist, such as calling first() or last() on an empty list, or next() on an exhausted iterator.
- scala NoSuchElementException Thrown when accessing an element that does not exist, such as calling head or last on an empty collection, or calling get on a None. In Scala, Option.get is the most common cause.