[Chapter 17] NoSuchElementException

#

| Chapter 17 The java.util Package |

# NoSuchElementException

## Name

NoSuchElementException

## Synopsis

Class Name:

  `java.util.NoSuchElementException`

Superclass:

  `java.lang.RuntimeException`

Immediate Subclasses:

  None

Interfaces Implemented:

  None

Availability:

  JDK 1.0 or later

## Description

A `NoSuchElementException` is thrown by `Enumeration` objects when there are no more elements to be returned.

## Class Summary

    public class java.util.NoSuchElementException
                 extends java.lang.RuntimeException {
      // Constructors
      public NoSuchElementException();
      public NoSuchElementException(String s);
    }

## Constructors

### NoSuchElementException

#### public NoSuchElementException()

Description

  This constructor creates a `NoSuchElementException` with no associated detail message.

#### public NoSuchElementException(String s)

Parameters

  `s`

    The detail message.

Description

  This constructor creates a `NoSuchElementException` with the specified detail message.

## Inherited Methods

Method | Inherited From | Method | Inherited From
--- | --- | --- | ---
`clone()` | `Object` | `equals(Object)` | `Object`
`fillInStackTrace()` | `Throwable` | `finalize()` | `Object`
`getClass()` | `Object` | `getLocalizedMessage()` | `Throwable`
`getMessage()` | `Throwable` | `hashCode()` | `Object`
`notify()` | `Object` | `notifyAll()` | `Object`
`printStackTrace()` | `Throwable` | `printStackTrace(PrintStream)` | `Throwable`
`printStackTrace(PrintWriter)` | `Throwable` | `toString()` | `Throwable`
`wait()` | `Object` | `wait(long)` | `Object`
`wait(long, int)` | `Object` |  |

## See Also

`Enumeration`, `Exception`, `RuntimeException`

MissingResourceException |  | Observable