java.lang.NumberFormatException: For input string: " 1"数字转换异常处理 image 根据错误信息可以看出来是数字格式转换异常,在"1"后面多了个空格 解决办法: Integer.parseInt(numString.trim())