How to compare null value from the JsonObject in java

前端 未结 7 950
灰色年华
灰色年华 2020-12-30 23:15

stackoverflow member i need some help from you.

I am having a JsonObject given below

{
\"Id\": null,
\"Name\": \"New Task\",
\"StartDate\": \"2010-03         


        
7条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-30 23:25

    Try the following codes.

    if(jsonObject.isNull("parentId") || jsonObject.get("parentId").equals(""))
    

提交回复
热议问题