Ask a Question
Advertise on boostr.in
when jsonobjects keys are iterated they arent in the same order as in the resp using -'java,json'
when jsonobjects keys are iterated they arent in the same order as in the resp ¬†using -'java,json'
I have a very large response from server of JSON string. I converted it to JSON object and then get the keys and iterate it.
The problem is that when I iterate it isnt in the same order as in response from server.
Next then I apply another method by adding all the keys in List<String> and the sort it and then get the iterator of that but still it isn't as I required (as in response).
Code example is here:
JSONObject jsonObject = new JSONObject(responseString);
¬†¬†¬†¬†Iterator<String> myIter = jsonObject.keys();
¬†¬†¬†¬†List<String> sortKey = new ArrayList<String>();
Sep 7, 2015
to add a comment.
Your name to display (optional):
Email me at this address if my answer is selected or commented on:
Email me if my answer is selected or commented on
Privacy: Your email address will only be used for sending these notifications.
To avoid this verification in future, please