在一个JsonObject中加入两个相同Key,不同Value的Item,在获取相应Key的值的时候,会得到最后加入的值,不会产生错误.(Mark)
JSONObject json = new JSONObject();
try {
json.put("test", "1");
json.put("test", "2");
Log.d("test",json.getString("test"));
} catch (JSONException e) {
e.printStackTrace();
}
打印结果为2.