Package java.util
Class InputMismatchException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
java.util.NoSuchElementException
java.util.InputMismatchException
- All Implemented Interfaces:
Serializable
public class InputMismatchException extends NoSuchElementException implements Serializable
An
InputMismatchException is thrown by a scanner to indicate that the
next token does not match or is out of range for the type specified in the
pattern.- See Also:
Scanner,RuntimeException, Serialized Form
-
Constructor Summary
Constructors Constructor Description InputMismatchException()Constructs a newInputMismatchExceptionwith the current stack trace filled in.InputMismatchException(String msg)Constructs a newInputMismatchExceptionwith the stack trace filled in andmsgas its error message. -
Method Summary
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
InputMismatchException
public InputMismatchException()Constructs a newInputMismatchExceptionwith the current stack trace filled in. -
InputMismatchException
Constructs a newInputMismatchExceptionwith the stack trace filled in andmsgas its error message.- Parameters:
msg- the specified error message.
-