当前位置: 代码迷 >> 综合 >> threw ‘java.lang.NullPointerException‘ exception // toString()
  详细解决方案

threw ‘java.lang.NullPointerException‘ exception // toString()

热度:55   发布时间:2024-01-05 13:10:47.0

Method threw 'java.lang.NullPointerException' exception. Cannot evaluate org.json.JSONObject.toString()
 

这就是 toString() 方法打印的数据有空指针。

------------

解决办法:

1>把 toString()方法删掉

2>对 toString()方法进行一点点修改,使得没有空对象