How can we change the order of JSON Object using Java?
问题 I am pretty new to JSON and trying to construct a new JSON request file using Java. Here is what I need to achieve { "ID": "9724234234", "Details": [ { "Name": "Donny", "EmpID": "B572345", "country": "India", } ] } Here is my Java code public static void main(String[] args) { JSONObject obb = new JSONObject(); obb.put("ID", "9724234234"); JSONArray jsonArray = new JSONArray(); obb.putAll(obb); JSONObject obj = new JSONObject(); obj.put("Name", "Donny"); obj.put("EmpID", "B572345"); obj.put(