InputMismatchException是什么意思? [英] What does InputMismatchException Mean?

查看:1453
本文介绍了InputMismatchException是什么意思?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Exception in thread "main" java.util.InputMismatchException

与扫描仪类一起使用时,对我来说意味着什么?完整的堆栈跟踪是

What it indicates for me while I'm using it with scanner class? Complete stacktrace is

Exception in thread "main" java.util.InputMismatchException
        at java.util.Scanner.throwFor(Unknown Source)
        at java.util.Scanner.next(Unknown Source)
        at java.util.Scanner.nextInt(Unknown Source)
        at java.util.Scanner.nextInt(Unknown Source)
        at ParseString.main(ParseString.java:9)


推荐答案

请参阅 JavaDoc上的文档

答案应该很明确:


由扫描程序,指示检索到的令牌与
不匹配预期类型的​​模式,或者令牌超出预期类型的​​
范围。

Thrown by a Scanner to indicate that the token retrieved does not match the pattern for the expected type, or that the token is out of range for the expected type.

这篇关于InputMismatchException是什么意思?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆