我想轉換一個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