I have two different arraylist of objects
ArrayList<Buckets> parent;
ArrayList<Buckets> child;
Now I want to initialize all the objects of child with parent's value using
child = new ArrayList<>(parent);
But after this whenever I make any changes in child, the parent arraylist also get updated. How can I make the child arraylist independent. I checked the other answers mostly are using collection but its not working here either. Can anyone kindly help me? thank you