I tried like below. I want to copy one array list of jsonobject to another without referencing to same...., Can anyone explain me what i am doing wrong??
ArrayList<JSONObject> a = new ArrayList<JSONObject>();
JSONObject aa = new JSONObject();
aa.put("key1", "old");
aa.put("key2", "old");
aa.put("key3", "old");
a.add(aa); `T`
ArrayList<JSONObject> b = new ArrayList<JSONObject>();
b = a;
b.get(0).put("key1", "new");
System.out.println(a);
System.out.println(b);