zoukankan      html  css  js  c++  java
  • Json 学习

     json 格式:

    1) 并列的数据之间用逗号(", ")分隔。

    2) 映射用冒号(": ")表示。

    3) 并列数据的集合(数组)用方括号("[]")表示。

    4) 映射的集合(对象)用大括号("{}")表示。

    Json 先是最小的数据 即   "Name":"小五台山"

      这些最小的数据用(“,”)隔开。  "PlaceType":"景点","AreaCode":107,"PlaceID":676

      加上 ("{}"), 作为一个对象 的一系列小数据  { "PlaceType":"景点","AreaCode":107},

                                                       {"PlaceType":"美食","AreaCode":676}

       上面这个也就相当于并列的数据(对象) 加 (",") 分割,  加上 ("[]") 构成数据的集合(数组)   

      [{ "PlaceType":"景点","AreaCode":107}, {"PlaceType":"美食","AreaCode":676}]

       若构成第一天的数据

     “Day1”:

     [{ "PlaceType":"景点","AreaCode":107}, {"PlaceType":"美食","AreaCode":676}]

    这个有构成对象的映射, 又可以理解为一个小数据, 加逗号分割。

     “Day1”:

     [{ "PlaceType":"景点","AreaCode":107}, {"PlaceType":"美食","AreaCode":676}],

    “Day2”:

     [{ "PlaceType":"景点","AreaCode":107}, {"PlaceType":"美食","AreaCode":676}]

    如此可以不断往复,构成各种数据。  最后加上一个 {} 即成 json 格式。 

  • 相关阅读:
    70.BOM
    69.捕获错误try catch
    68.键盘事件
    523. Continuous Subarray Sum
    901. Online Stock Span
    547. Friend Circles
    162. Find Peak Element
    1008. Construct Binary Search Tree from Preorder Traversal
    889. Construct Binary Tree from Preorder and Postorder Traversal
    106. Construct Binary Tree from Inorder and Postorder Traversal
  • 原文地址:https://www.cnblogs.com/awake-insist/p/5010507.html
Copyright © 2011-2022 走看看