int Age11;
if (request.getParameter( "Age1 ") == null
|| request.getParameter( "Age1 ").equals( " ")) {
Age11=0;
} else {
Age11=Integer.parseInt((String)request.getParameter( "Age1 "));
}
这是一个表单判断的处理,但是我想得到的结果是,当request.getParameter( "Age1 ") == null时,Age11=null;但我不知道该怎么转换,请高手赐教~~
------解决方案--------------------
如果本来就是null的话,直接提取复制还是null,不用判断了
------解决方案--------------------
是NULL的话给Age11赋值NULL?
------解决方案--------------------
Integer Age11;
if()
Age11 = null ;
else
Age11 = new Integer(request.get....)
------解决方案--------------------
int Age11;
if (request.getParameter( "Age1 ") == null
|| request.getParameter( "Age1 ").equals( " ")) {
Age11= null;
} else {
Age11=Integer.parseInt(request.getParameter( "Age1 "));
}
------解决方案--------------------
int 能是 null么?!
Integer
------解决方案--------------------
if (request.getParameter( "Age1 ") == null {
Age11= null;
} else{
Age11=Integer.parseInt(request.getParameter( "Age1 ").trim());
}