java判断不为空

时间:2015-01-30 19:11:55   收藏:0   阅读:133

因为java是强类型语言,所以判断空的时候分null 和字符串空

if(userID == null || "".equals(userID)){
		 response.sendRedirect("login.jsp?errorType="+Utility.encrypt("1")+"&userID="+userID);
		 return;
	 }

 

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!