GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Overview
  • Module
  • Package
  • Use
  • Tree
  • Preview
  • New
  • Deprecated
  • Index
  • Help
  • SEARCH

This view

  • Original page
  • New address

GeezerVison is showing docs.oracle.com — NoSuchElementException (Java SE 21 & JDK 21)

Module java.base
Package java.util

Class NoSuchElementException

java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
java.util.NoSuchElementException
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
InputMismatchException

public class NoSuchElementException extends RuntimeException
Thrown by various accessor methods to indicate that the element being requested does not exist.
Since:
1.0
See Also:
  • Enumeration.nextElement()
  • Iterator.next()
  • Serialized Form
  • Constructor Summary

    Constructors
    Constructor
    Description
    NoSuchElementException()
    Constructs a NoSuchElementException with null as its error message string.
    NoSuchElementException(String s)
    Constructs a NoSuchElementException, saving a reference to the error message string s for later retrieval by the getMessage method.
    NoSuchElementException(String s, Throwable cause)
    Constructs a NoSuchElementException with the specified detail message and cause.
    NoSuchElementException(Throwable cause)
    Constructs a NoSuchElementException with the specified cause.
  • Method Summary

    Methods declared in class java.lang.Throwable

    addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString

    Methods declared in class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • NoSuchElementException

      public NoSuchElementException()
      Constructs a NoSuchElementException with null as its error message string.
    • NoSuchElementException

      public NoSuchElementException(String s, Throwable cause)
      Constructs a NoSuchElementException with the specified detail message and cause.
      Parameters:
      s - the detail message, or null
      cause - the cause (which is saved for later retrieval by the Throwable.getCause() method), or null
      Since:
      15
    • NoSuchElementException

      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 - the cause (which is saved for later retrieval by the Throwable.getCause() method)
      Since:
      15
    • NoSuchElementException

      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 - the detail message.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.