Hi All,

I am facing an issue to copy a ArrayList without copying its references.
Suppose arrayList contains some lineItems present in object.
Below is the code snippet I used.
Example:

List arrayList= new ArrayList();
arrayList.add(object);

List newArrayList = new ArrayList();
newArrayList.addAll(arrayList);

If I delete any lineItems from the newly created list (newArrayList). Same lineItems are also getting deleted from the main list (arrayList).

Is there any way to copy the arraylist without the references being copied?
If itís possible to do so. Could anyone please provide the code snippet.

Thanks in advance.

Regards,
Partho