java.util
Class InputMismatchException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by java.lang.RuntimeException
              extended by java.util.NoSuchElementException
                  extended by 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

Constructor Summary
InputMismatchException()
          Constructs a new InputMismatchException with a null message.
InputMismatchException(String s)
          Constructs a new InputMismatchException with the supplied error message.
 
Method Summary
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

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.