Skip to content

Most visited

Recently visited

navigation
Added in API level 1

InputMismatchException

public class InputMismatchException
extends NoSuchElementException implements Serializable

java.lang.Object
   ↳ java.lang.Throwable
     ↳ java.lang.Exception
       ↳ java.lang.RuntimeException
         ↳ java.util.NoSuchElementException
           ↳ java.util.InputMismatchException


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:

Summary

Public constructors

InputMismatchException()

Constructs a new InputMismatchException with the current stack trace filled in.

InputMismatchException(String msg)

Constructs a new InputMismatchException with the stack trace filled in and msg as its error message.

Inherited methods

From class java.lang.Throwable
From class java.lang.Object

Public constructors

InputMismatchException

Added in API level 1
InputMismatchException ()

Constructs a new InputMismatchException with the current stack trace filled in.

InputMismatchException

Added in API level 1
InputMismatchException (String msg)

Constructs a new InputMismatchException with the stack trace filled in and msg as its error message.

Parameters
msg String: the specified error message.
This site uses cookies to store your preferences for site-specific language and display options.

Hooray!

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.