3 回答

TA貢獻(xiàn)1893條經(jīng)驗(yàn) 獲得超10個(gè)贊
并列的數(shù)據(jù)之間用逗號(hào)(”, “)分隔。
映射用冒號(hào)(”: “)表示。
并列數(shù)據(jù)的集合(數(shù)組)用方括號(hào)(“[]“)表示。
映射的集合(對(duì)象)用大括號(hào)(”{}”)表示。上面四條規(guī)則,就是Json格式的所有內(nèi)容。
例:
var json = {
"name":"Tom" "age":24 "hobby":[sleep, read, music] "other":{ "other1":1, "other2":2, "other3":[{ "other4":4 "other5":5 }, { "other6":6, "other7":7 }] }}
這個(gè)去掉外面的“”就是數(shù)組,數(shù)組里面就一個(gè)元素是json對(duì)象的元素,然后json對(duì)象里面的第三個(gè)又是數(shù)組!

TA貢獻(xiàn)1895條經(jīng)驗(yàn) 獲得超3個(gè)贊
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | var json = { "name":"Tom" "age":24 "hobby":[sleep, read, music] "other":{ "other1":1, "other2":2, "other3":[{ "other4":4 "other5":5 }, { "other6":6, "other7":7 }] } } |
嵌套數(shù)組和對(duì)象

TA貢獻(xiàn)2011條經(jīng)驗(yàn) 獲得超2個(gè)贊
用二維數(shù)組表示
String[][] aa=new String[100][100];
name就是 aa[0][0]
age就是 aa[1][0]
hobby就是 a[2][0] a[2][1] a[2][2]
添加回答
舉報(bào)