我想转换一个JSON字符串数组到Java是从这段JavaScript给出:将JSON数组转换为Java?
javaFunction(["a1", "a2"]); <--- This is called in javascript
在Java
public static void javaFunction(<What here?> jsonStringArray){ //<---- This is called in Java
//Convert the JSON String array here to something i can iterate through,
//For example:
for(int index = 0; index < convertedArray.length; index++){
System.out.println(convertedArray[index];
}
}
没有为JSON处理的Java API:http://www.oracle.com/technetwork/articles/java/json-1973242.html – Markai 2014-11-21 12:21:12
你可以打印您的JSON数组,并显示它,所以我们可以给你确切的答案? – 2014-11-21 12:27:25
JSON数组在问题第一行代码行 – ErikBrandsma 2014-11-21 12:32:52