3 回答

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

TA貢獻1845條經驗 獲得超8個贊
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 }] } } |
嵌套數組和對象

TA貢獻2051條經驗 獲得超10個贊
用二維數組表示
String[][] aa=new String[100][100];
name就是 aa[0][0]
age就是 aa[1][0]
hobby就是 a[2][0] a[2][1] a[2][2]
- 3 回答
- 0 關注
- 786 瀏覽
添加回答
舉報