展开全部
能解释你这个问题的最好方法就是查看源代码。try {
String s = next(integerPattern());
if (matcher.group(SIMPLE_GROUP_INDEX) == null)
s = processIntegerToken(s);
return Long.parseLong(s, radix);
} catch (NumberFormatException nfe) {
position = matcher.start(); // don't skip bad token
throw new InputMismatchException(nfe.getMessage());
上面是nextLong()方法中的一个代码段,从String s = next(integerPattern());可以看到,nextLong()方法也是按照int类型来匹配e69da5e6ba903231313335323631343130323136353331333335333737的。所以加了L或超过整数范围都会抛出异常。
如果你确实想读入long类型,你可以先读入字符串,在把字符串转化为弄类型。