Json学习笔记

来源:互联网 发布:软件接口要求 编辑:程序博客网 时间:2024/06/08 13:23

JSON —> JavaScript Object Notation, 一种轻量级的数据交换格式。

一、JSON的形式:

              1)对象Object。无序的“名称/值对集合”。{name1:value1, name2:name2, key3:name3}

                name为string。

 

              2)数组Array。值的有序集合。[value1, value2,value3]    

 

 

二、值 value

       双引号括起来的字符串string、数值number、true、false、null、对象object或者数组array。允许嵌套。

三、JSON文本是一系列遵循JSON value语法的Unicode符号。

      JSON符号包括6种结构符号、strings、numbers和3中名称符号。

      结构性符号(6种):[  {  ]  }  :  ,

      文本名称符号(3种):true  false  null

四、JSON只有一种数字形式,即number,这样便于不同编程语言间数据交换。

       JSON is agnostic about numbers. In any programming language, there can be a variety of number types of various capacities and complements, fixed or floating, binary or decimal. That can make interchange between different programming languages difficult. JSON instead offers only the representation of numbers that humans use: a sequence of digits. All programming languages know how to make sense of digit sequences even if they disagree on internal representation. That is enough to allow interchange.

 

参考资料: 1、JSON官网介绍 http://www.json.org/json-zh.html

0 0
原创粉丝点击