Re: Deep copy of ArrayList?
Assuming that data and array are both ArrayLists, and y is some index, then the same Object will be in both ArrayLists. You can test this just by using the == operator on the references returned by the get() methods of each ArrayList.
Re: Deep copy of ArrayList?
But is it a deep copy? As when I replace the data in the first arrayList (array) then both the arrayLists change. (That or I have another error)
Re: Deep copy of ArrayList?
What happened when you tried? It shouldn't be too hard to throw together a test program that tests this out. I'm really not even sure what you're asking- you mean if you modify the Object that's in both ArrayLists? Or if you add a new Object to one of the ArrayLists?