Module java.base
Package java.util

Class InputMismatchException

所有已实现的接口:
Serializable

public class InputMismatchException extends NoSuchElementException
Scanner抛出,表示检索到的标记与预期类型的模式不匹配,或者标记超出了预期类型的范围。
自 JDK 版本:
1.5
参见:
  • Constructor Details

    • InputMismatchException

      public InputMismatchException()
      构造一个带有null作为其错误消息字符串的InputMismatchException
    • InputMismatchException

      public InputMismatchException(String s)
      构造一个InputMismatchException,保存对错误消息字符串s的引用,以便稍后通过getMessage方法检索。
      参数:
      s - 详细消息。