Copying ArrayLists without affecting original


Is there a way to create a new copy of an ArrayList full of custom classes (in case it’s relevant), such that modifications to the objects in the new list will not affect the originals?

Failing that, is there a way to copy an object short of explicitly writing a copy method that instantiates a new object with the same parameters?


1 Like