版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/sinat_15411661/article/details/52230059
java.lang.NumberFormatException: Invalid int: ""不能成功转成int类型
错误代码:
private int allCount;
String temp = null;
allCount = Integer.parseInt(temp);
更改代码(添加try catch使之兼容性增强):
try {
String temp = null;
allCount = Integer.parseInt(temp);
} catch (Exception e) {
allCount = 200;
}