I am writing a service that uses a REST API of another service. I have ended up with a lot of methods that receive a JSON response that need to be parsed and passed into the system. I have been iterating n the following way
for (int i=0; i < JSONArray.length(); i ++) {
JSONObject jsonObject = JSONArray.get(i);
}
Is this the only way and the recommended way of doing this? Since this does not implement an iterable interface?
I am using or.json.JSONArray