求解答java.lang.NumberFormatException: For input string: "姚雪娟"类异常
else if(OPERATION_UPDATE.equals(in.toUpperCase())
||OPERATION_UPDATE.substring(0, 1).equals(in.toUpperCase())
||OPERATION_UPDATE.equals(pervious)){
pervious=OPERATION_UPDATE;
if(1==step){
System.out.println("请输入要修改的员工ID:");
}else if(2==step){
Integer id=null;
try {
id = Integer.valueOf(in);
try {
user = action.getById(id);
if(user==null){
System.out.println("查询员工信息失败");
step=1;
}else{
System.out.println("请输入新的员工信息[姓名]:");
}
} catch (Exception e) {
System.out.println("查询员工信息失败");
step=1;
}
} catch (Exception e) {
System.out.println("请输入正确的员工ID:");
step=1;
}
}else if(3==step){
System.out.println(in);
if(-1!=Integer.valueOf(in)){
user.setName(in);
}
System.out.println("请输入新的员工信息[性别]:");
}
这是view层一段代码,运行update方法时,当输入姓名为:姚雪娟时,提示
Exception in thread "main" java.lang.NumberFormatException: For input string: "姚雪娟"
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
at java.lang.Integer.parseInt(Integer.java:449)
at java.lang.Integer.valueOf(Integer.java:554)
at com.view.View.main(View.java:218)
这是怎么回事?