Use this tag if your problem is caused by or primarily involves a NoSuchElementException in Java.
The NoSuchElementException is a RuntimeException thrown by the nextElement method of an Enumeration to indicate that there are no more elements in the enumeration.
It is also thrown by:
- the various
next*methods (nextInt,nextFloat,nextLine,...) of theScannerclass when input is exhausted; - the
getmethod of the Java 8Optionalclass when a value is not present; - the methods
firstElementandlastElementin theVectorclass when there are no elements; - the methods
firstKeyandlastKeyin theTreeMapclass when there are no keys; - the methods
getFirst,getLast,removeFirstandremoveLastinLinkedListwhen there are no elements;
and other collections.