I am trying to convert a JSONArray whose String format is multi-dimensional to a Java multi-dimensional array. I have tried a lot of ways by myself and am getting lost in my task. Hopefully someone here can bring some clarity. Converting to a normal array is fine. But when I try to extend myself to a multi-dimensional I can't.
public static final String stationData[][] = {
// Station Names
{ "The Point", "Spencer Dock", "Mayor Square - NCI",
"George's Dock", "Bus Aras", "Connolly", "Brides Glen",
"Cherrywood", "Laughanstown", "Carrickmines" },
// Station Url Fragments
{ "The%20Point", "Spencer%20Dock", "Mayor%20Square%20-%20NCI",
"George%27s%20Dock", "Bus%26aacute%3Bras", "Connolly",
"Brides%20Glen", "Cherrywood", "Laughanstown",
"Carrickmines"}
};
JSONArray myArray = (JSONArray) JSONSerializer.toJSON(stationData);
I am just playing around with this array to see if I can get it to work. So at this point in my code can anyone tell me how to: from the JSONArray I have re-create the java multi-dimensional array it was created by?
Help would be greatly appreciated. Thank you.