</div> </div>
运行结果如下:
通过构造器的方式创建的JSONObject对象:{"derek":"23","dad":"49","mom":"45"}
通过fromObject方法将map对象转换为JSONObject对象:{"derek":"23","dad":"49","mom":"45"}
通过构造器的方式创建的JSONArray:["derek","dad","mom"]
通过fromObject方法将Arraylist对象转换为JSONArray对象:["derek","dad","mom"]
将HashMap对象通过fromObject方法转换为JSONArray对象[{"derek":"23","dad":"49","mom":"45"}]
解析之后的JSON对象:{"derek":23,"dad":49,"mom":45}
derek:23
dad:49
mom:45