What is the difference between a JsonValue and a JsonObject?
I see that JsonValue is the base class for JsonObject, JsonPrimitive and JsonArray. But aren't all of them simply JsonObjects?
What is the difference between a JsonValue and a JsonObject?
I see that JsonValue is the base class for JsonObject, JsonPrimitive and JsonArray. But aren't all of them simply JsonObjects?
JsonValue is , as you said, the base class of the three classes in questions. It is also abstract. This suggests that it represents something general. It's a general term.
JsonObject is a kind of JsonValue (since the former inherits from the latter). Which kind? This kind:
{ ... }
JsonArray is another kind of JsonValue. Which kind? This kind:
[ ... ]
JsonPrimitive is the third kind of JsonValue, and it represents the 3 other types of values you can have in JSON - Number, String, Boolean.