I have a List which i get like following :
List<MyObject> list = complexObject.getMyObjectList();
for(final MyObject obj in list){
// set something in obj. .............(1)
}
I debugged the above code and looked found out the the modified MyObject's are not reflected in the complexObject unless I do something like following..
complexObject.setList(list);
I thought Java does everything by "Pass by reference". Am i missing something. ?