Name

InputMismatchException

Synopsis

An exception of this type is thrown by a Scanner that is not of the expected type or is out of range. Note that the Scanner implements the Iterator interface, and this exception is a subclass of NoSuchElementException, which is thrown by Iterator.next( ) when no more elements are available.

java.util.InputMismatchException

Figure 16-34. java.util.InputMismatchException

public class InputMismatchException extends NoSuchElementException {
// Public Constructors
     public InputMismatchException( );  
     public InputMismatchException(String s);  
}

Get Java in a Nutshell, 5th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.