java.util

Class InputMismatchException

public class InputMismatchException extends NoSuchElementException

Thrown when a {@link 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

Constructor Summary
InputMismatchException()
Constructs a new InputMismatchException with a null message.
InputMismatchException(String s)
Constructs a new InputMismatchException with the supplied error message.

Constructor Detail

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.