转成integer之后运算仍然是字符串的拼接
String code=areaBizImpl.getCodeById(Integer.parseInt(supid));Integer codeint = Integer.parseInt(code);System.out.println(codeint+2222);if(param.equalsIgnoreCase("province")&&supid.equalsIgnoreCase("1")){System.out.println("province"+"---"+codeint+10000);}
?如果codeint 为100,那么结果为10010000。
?
?注意:字符串和整形的数字相加之后还是字符串。
?
?但是如果code=091100的话 转换成integer就会出现问题,结果为91100显然和我们想要的结果不符。
?
?