@Testpublic void demo93() throws Exception {String str = "[\"a\", \"b\", \"c\"]";//生成json数组JSONArray createArray = new JSONArray();createArray.put("a");createArray.put("b");createArray.put("c");System.out.println("createJSONArray: " + createArray);//解析json数组JSONArray parseArray = new JSONArray(str);System.out.println("parseJSONArray: " + parseArray);for(int i = 0; i < parseArray.length(); i++) {System.out.print(parseArray.get(i) + " ");}}
输出: