I have a linkedlist which contains objects that are not cloneable. What would be the most efficient way to deep copy the list?
What I have tried is:
List<Ob> deepCopyListA = new LinkedList<Ob>(aList);
and it seems to work fine, but I am just wondering if it is actually deep copying the whole list and if there is any better way to do it
*I am not sure what codes to post, but basically I have a class, and a number of instances of the class as a list in another class
private List<Ob> aList;
public List<Ob> getaList() {
List<Ob> deepCopyListA = new LinkedList<Ob>(aList);
return deepCopyListA;
}