JSON数据里NULL值判断
时间:2020-06-04 18:20:42
收藏:0
阅读:45
Object t=json.get("key");
当json数据中有key,对应的值为null时,debug显示t的类型是JSONNull,不能直接t==null判断,
需要这样:
if(t==null||JSONNull.getInstance().equals(t)){ }
导包net.sf.json.JSONNull
原文:https://www.cnblogs.com/yanan7890/p/13045220.html
评论(0)