图1是要求运行的结果
什么意思哦?你指输入ID还是密码啊
因为你的用户名 ID=input.nextInt(); 这个nextInt()方法内部
```java
public int nextInt(int radix) {
// Check cached result
if ((typeCache != null) && (typeCache instanceof Integer)
&& this.radix == radix) {
int val = ((Integer)typeCache).intValue();
useTypeCache();
return val;
}
setRadix(radix);
clearCaches();
// Search for next int
try {
String s = next(integerPattern());
if (matcher.group(SIMPLE_GROUP_INDEX) == null)
s = processIntegerToken(s);
return Integer.parseInt(s, radix);
} catch (NumberFormatException nfe) {
position = matcher.start(); // don't skip bad token
** throw new InputMismatchException(nfe.getMessage());**
}
}
```
你可以使用input.next()方法取输入值,或者trycatch异常进行类型的提示
谢谢各位,我把ID的定义类型和password搞反了