There are currently two types of packages found. Two different JSON packages. The first case is that the JSON package is the Json-lib package is Net.sf.json
How to tell if Jsonobject returns a string null or a null value.
Research source Discovery. There is a piece of code in Jsonobject that is when it encounters null in the JSON string. Returns Jsonnull. So when you differentiate null: jsonobject Jo = Jsonobject.fromobject ("{a:null,b:\" null \ "}"), Object o = Jo.get ("a"), if (o instanceof jsonnull) {System.out.println ("is empty null");} Else{system.out.println ("is String null");} o = Jo.get ("b"), if (o instanceof jsonnull) {System.out.println ("is empty null");} Else{system.out.println ("is String null");} The result of the input is the second case: Org.json's package Jsonobject Jo = new Jsonobject (("{\" a\ ": \" null\ ", \" b\ ": null}")); if (Jo.get ("a") instanceof String) {System.out.println ("A is String null");} Else{system.out.println ("A is empty null"); if (Jo.get ("B") instanceof string) {System.out.println ("A is String null");} Else{system.out.println ("A is empty null"); System.out.println (Jo.get ("B"). GetClass ()); It was discovered at this time. Null returned is a null value that is jsonobject.null two different packages
Jsonobject is judged null in Java