< prev index next >

src/java.base/share/classes/java/util/NoSuchElementException.java

Print this page




  30  * does not exist.
  31  *
  32  * @author  unascribed
  33  * @see     java.util.Enumeration#nextElement()
  34  * @see     java.util.Iterator#next()
  35  * @since   1.0
  36  */
  37 public class NoSuchElementException extends RuntimeException {
  38     @java.io.Serial
  39     private static final long serialVersionUID = 6769829250639411880L;
  40 
  41     /**
  42      * Constructs a {@code NoSuchElementException} with {@code null}
  43      * as its error message string.
  44      */
  45     public NoSuchElementException() {
  46         super();
  47     }
  48 
  49     /**



























  50      * Constructs a {@code NoSuchElementException}, saving a reference
  51      * to the error message string {@code s} for later retrieval by the
  52      * {@code getMessage} method.
  53      *
  54      * @param   s   the detail message.
  55      */
  56     public NoSuchElementException(String s) {
  57         super(s);
  58     }
  59 }


  30  * does not exist.
  31  *
  32  * @author  unascribed
  33  * @see     java.util.Enumeration#nextElement()
  34  * @see     java.util.Iterator#next()
  35  * @since   1.0
  36  */
  37 public class NoSuchElementException extends RuntimeException {
  38     @java.io.Serial
  39     private static final long serialVersionUID = 6769829250639411880L;
  40 
  41     /**
  42      * Constructs a {@code NoSuchElementException} with {@code null}
  43      * as its error message string.
  44      */
  45     public NoSuchElementException() {
  46         super();
  47     }
  48 
  49     /**
  50      * Constructs a {@code NoSuchElementException} with the specified detail
  51      * message and cause.
  52      *
  53      * @param s     the detail message, or null
  54      * @param cause the cause (which is saved for later retrieval by the
  55      *              {@link #getCause()} method), or null
  56      * @since 15
  57      */
  58     public NoSuchElementException(String s, Throwable cause) {
  59         super(s, cause);
  60     }
  61 
  62     /**
  63      * Constructs a {@code NoSuchElementException} with the specified cause.
  64      * The detail message is set to {@code (cause == null ? null :
  65      * cause.toString())} (which typically contains the class and
  66      * detail message of {@code cause}).
  67      *
  68      * @param cause the cause (which is saved for later retrieval by the
  69      *              {@link #getCause()} method)
  70      * @since 15
  71      */
  72     public NoSuchElementException(Throwable cause) {
  73         super(cause);
  74     }
  75 
  76     /**
  77      * Constructs a {@code NoSuchElementException}, saving a reference
  78      * to the error message string {@code s} for later retrieval by the
  79      * {@code getMessage} method.
  80      *
  81      * @param   s   the detail message.
  82      */
  83     public NoSuchElementException(String s) {
  84         super(s);
  85     }
  86 }
< prev index next >