APIdia Launch Partner
Top Description Fields Constructors
java.util

public Class NoSuchElementException

extends RuntimeException
Class Inheritance
Known Direct Subclasses
java.util.InputMismatchException

Thrown by various accessor methods to indicate that the element being requested does not exist.
Since
1.0
See Also
java.util.Enumeration#nextElement(), java.util.Iterator#next()

Field Summary

Modifier and TypeField and Description
private static final long

Constructor Summary

AccessConstructor and Description
public
NoSuchElementException()

Constructs a NoSuchElementException with null as its error message string.

public
NoSuchElementException(String
the detail message, or null
s
,
Throwable
the cause (which is saved for later retrieval by the getCause() method), or null
cause
)

Constructs a NoSuchElementException with the specified detail message and cause.

public
NoSuchElementException(Throwable
the cause (which is saved for later retrieval by the getCause() method)
cause
)

Constructs a NoSuchElementException with the specified cause.

public
NoSuchElementException(String
the detail message.
s
)

Constructs a NoSuchElementException, saving a reference to the error message string s for later retrieval by the getMessage method.

Field Detail

serialVersionUIDback to summary
private static final long serialVersionUID

Hides java.lang.RuntimeException.serialVersionUID.

Annotations
@Serial

Constructor Detail

NoSuchElementExceptionback to summary
public NoSuchElementException()

Constructs a NoSuchElementException with null as its error message string.

NoSuchElementExceptionback to summary
public NoSuchElementException(String s, Throwable cause)

Constructs a NoSuchElementException with the specified detail message and cause.

Parameters
s:String

the detail message, or null

cause:Throwable

the cause (which is saved for later retrieval by the getCause() method), or null

Since
15
NoSuchElementExceptionback to summary
public NoSuchElementException(Throwable cause)

Constructs a NoSuchElementException with the specified cause. The detail message is set to (cause == null ? null : cause.toString()) (which typically contains the class and detail message of cause).

Parameters
cause:Throwable

the cause (which is saved for later retrieval by the getCause() method)

Since
15
NoSuchElementExceptionback to summary
public NoSuchElementException(String s)

Constructs a NoSuchElementException, saving a reference to the error message string s for later retrieval by the getMessage method.

Parameters
s:String

the detail message.