< prev index next >

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

Print this page

        

@@ -54,6 +54,33 @@
      * @param   s   the detail message.
      */
     public NoSuchElementException(String s) {
         super(s);
     }
+
+    /**
+     * Constructs a {@code NoSuchElementException} with the specified detail
+     * message and cause.
+     *
+     * @param s     the detail message, or null
+     * @param cause the cause (which is saved for later retrieval by the
+     *              {@link #getCause()} method), or null
+     * @since 15
+     */
+    public NoSuchElementException(String s, Throwable cause) {
+        super(s, cause);
+    }
+
+    /**
+     * Constructs a {@code NoSuchElementException} with the specified cause.
+     * The detail message is set to {@code (cause == null ? null :
+     * cause.toString())} (which typically contains the class and
+     * detail message of {@code cause}).
+     *
+     * @param cause the cause (which is saved for later retrieval by the
+     *              {@link #getCause()} method)
+     * @since 15
+     */
+    public NoSuchElementException(Throwable cause) {
+        super(cause);
+    }
 }
< prev index next >