Consider the following code snippet:
JSONObject json = new JSONObject();
json.put("one", 1);
json.put("two", 2);
json.put("three", 3);
If I print jsonobject, it prints like this
{"three":"1","two":"2","one":"1"}
But I want it like that.
{"one":"1","two":"2","three":"3"}
Please, help. Thanks in advance.
source
share