Package java.util

Class 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 Details

    • InputMismatchException

      public InputMismatchException()
      Constructs a new InputMismatchException with the current stack trace filled in.
    • InputMismatchException

      public InputMismatchException​(String msg)
      Constructs a new InputMismatchException with the stack trace filled in and msg as its error message.
      Parameters:
      msg - the specified error message.