How can I clone an ArrayList and also clone its items in Java?
ArrayList
For example I have:
ArrayList dogs = getDogs(); ArrayList
The package import org.apache.commons.lang.SerializationUtils;
import org.apache.commons.lang.SerializationUtils;
There is a method SerializationUtils.clone(Object);
SerializationUtils.clone(Object);
Example
this.myObjectCloned = SerializationUtils.clone(this.object);