我是 JSON 的新手,我正在尝试将我的 JSON 文件解析为 Java,并且它可以工作,但是我有包含更多数组的对象/数组,我不知道如何正确迭代它。这是我的 JSON 文件:
{
"quiz": {
"sport": {
"q1": {
"question": "Which one is correct team name in NBA?",
"options": [
"New York Bulls",
"Los Angeles Kings",
"Golden State Warriros",
"Huston Rocket"
],
"answer": "Huston Rocket"
}
},
"maths": {
"q1": {
"question": "5 + 7 = ?",
"options": [
"10",
"11",
"12",
"13"
],
"answer": "12"
},
"q2": {
"question": "12 - 8 = ?",
"options": [
"1",
"2",
"3",
"4"
],
"answer": "4" …Run Code Online (Sandbox Code Playgroud)