Java

Json Object VS Json Array

2021-09-22  本文已影响0人  JaedenKil

Easiest understanding:

When syntax is {} then this is JsonObject
When syntax is [] then this is JsonArray

JSONObject:

JSONArray:

Additional info:
We can use the Array first approach if we intend to store a set of values with no need to identify uniquely.

[
   {
      "Employees":[
         {
            "Name":"Alan",
            "Children":[
               "Walker",
               "Dua",
               "Lipa"
            ]
         },
         {
            "Name":"Ezio",
            "Children":[
               "Kenvey",
               "Connor",
               "Edward"
            ]
         }
      ]
   }
]
上一篇下一篇

猜你喜欢

热点阅读