Hello.
I get a json response from the server:
[{"password":"xxxxxxx"}] How can json simple get password 'a?
JSONArray with a given key;JSONArray element by index. JSONParser parser = new JSONParser(); try { JSONObject object = (JSONObject) parser.parse("{\"items\":[\"password\",\"xxxxxxx\"]}"); JSONArray items = (JSONArray) object.get("items"); System.out.println(items.get(1)); } catch (ParseException e) { e.printStackTrace(); } Source: https://ru.stackoverflow.com/questions/595886/
All Articles