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
Thrown when a Scanner
instance encounters a mismatch
between the input data and the pattern it is trying to match it
against. This could be because the input data represents an
out-of-range value for the type the pattern represents, or simply
because the data does not fit that particular type.
- Since:
- 1.5
- See Also:
- Serialized Form
Methods inherited from class java.lang.Throwable |
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString |
InputMismatchException
public InputMismatchException()
- Constructs a new
InputMismatchException
with a null
message.
InputMismatchException
public InputMismatchException(String s)
- Constructs a new
InputMismatchException
with the supplied error message.
- Parameters:
s
- the error message to report back to the user.