我在Map 里存了一组数据,是在数据库查询出来的,里面有Null值,若m.get("v_contact_office"); 这样直接获取,如果遇到Null值就会报错了,我应该怎样判断是否有空值。
解决方案 »
- C# 与java通信问题
- ssh中spring管理事务的问题
- 很简单的SSH问题 org.springframework.dao.DataIntegrityViolationException 大侠们给看看
- struts2.1中The Struts dispatcher cannot be found的问题...
- 用excel做报表时候,怎样在excel中显示从数据库里读取的图片???
- n级连动菜单征集方案
- webservice服务:jboss4.0.2 + axis1.2.1的配置问题?急急急....
- 高分求教:请问如何把tomcat里的catalina.out输出变小?
- 如何调用连接池呢!
- 连接oracle的问题
- RSA加解密报错问题!!!
- 类似QQ邮箱的多文件上传下载在线预览
那就if一下呗...
Object value = m.get("v_contact_office");
if(value != null) {
// DO SOMETHING
}
HashMap map = new HashMap();
map.put(null, null);
map.put("name", "jack");
System.out.println(map.get("name"));
System.out.println(map.containsKey(null));
System.out.println(map.containsValue(null));