在程序的编辑过程中有如下问题:
在用Integer.parseIn()时会出现null或是小数,那样就会发出异常java.lang.NumberFormatException: For input string
解决方法如下:
1: 为null时,进行判断
if(xx == null){
} else{
Integer.parse(xx);
}
2: 当为小数时:
(int)Double.parseDouble(xx) --------进行强转
在程序的编辑过程中有如下问题:
在用Integer.parseIn()时会出现null或是小数,那样就会发出异常java.lang.NumberFormatException: For input string
解决方法如下:
1: 为null时,进行判断
if(xx == null){
} else{
Integer.parse(xx);
}
2: 当为小数时:
(int)Double.parseDouble(xx) --------进行强转