java.util
Class NoSuchElementException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by java.lang.RuntimeException
              extended by java.util.NoSuchElementException

public class NoSuchElementException
extends RuntimeException

Exception thrown when an attempt is made to access an element that does not exist. This exception is thrown by the Enumeration, Iterator and ListIterator classes if the nextElement, next or previous method goes beyond the end of the list of elements that are being accessed. It is also thrown by Vector and Stack when attempting to access the first or last element of an empty collection.

Since:
1.0
See Also:
Enumeration, Iterator, ListIterator, Enumeration.nextElement(), Iterator.next(), ListIterator.previous()

Constructor Summary
NoSuchElementException()
          Constructs a NoSuchElementException with no detail message.
NoSuchElementException(String detail)
          Constructs a NoSuchElementException with a detail message.
 
Method Summary
 
Methods inherited from class java.lang.Throwable
getCause, getLocalizedMessage, getMessage, initCause, printStackTrace, printStackTrace, printStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NoSuchElementException

public NoSuchElementException()
Constructs a NoSuchElementException with no detail message.


NoSuchElementException

public NoSuchElementException(String detail)
Constructs a NoSuchElementException with a detail message.

Parameters:
detail - the detail message for the exception