淘先锋技术网

首页 1 2 3 4 5 6 7

json数组格式?

示例说明

JSON 格式表示数组

保存名字的数组: ["张三","李四","王五"]

保存雇员的信息: ["smith",1001,"clerck",7788,2000.00,200.0]

[

["smith",1001,"clerck",7788,2000.00,200.0]

["smith",1001,"clerck",7788,2000.00,200.0]

["smith",1001,"clerck",7788,2000.00,200.0]

]

[

{"name":"smith","empno":1001,"job":"clerck","sal":9000.00,"comm":5000.00},

{"name":"smith","empno":1001,"job":"clerck","sal":9000.00,"comm":5000.00},

{"name":"smith","empno":1001,"job":"clerck","sal":9000.00,"comm":5000.00},

]

Demo: 对象数组

在一个数组保存多个 json 对象 (在一个数组中保存多个对象)

[

{

"title":"Java 开发",

"edition":3,

"author":["smith","张三","李四"]

},

{

"title":"Web 开发",

"edition":3,

"author":["Allen","王五","赵六"]

}

]

二维数组保存

[

["Java 开发",3,["smith","张三","李四"]],

["Web 开发",3["Allen","王五","赵六"]]

]

java 数组参数,json数组格式