这个不报异常!后台只显示如下提示:
Exception in thread "main" java.lang.Error: Unresolved compilation problem:
The literal 111111111111111 of type int is out of range at Test3.main(Test3.java:31)只能通过判断范围的条件来做吗?
Exception in thread "main" java.lang.Error: Unresolved compilation problem:
The literal 111111111111111 of type int is out of range at Test3.main(Test3.java:31)只能通过判断范围的条件来做吗?
这是内存溢出引启的
int b = 0;
try {
b = Integer.parseInt(a);
System.out.println(b);
} catch (Exception e) {
System.out.println("越界");
}
若大于,则就用BigInteger