今天在写业务代码时,自己写了一个bug,特此记录一下:
JSONObject中获取boolean数据
boolean result = (boolean) jsonObject.get("result");
这样是获取不到的应该
boolean result = jsonObject.getBooleanValue("result");
今天在写业务代码时,自己写了一个bug,特此记录一下:
JSONObject中获取boolean数据
boolean result = (boolean) jsonObject.get("result");
这样是获取不到的应该
boolean result = jsonObject.getBooleanValue("result");