标签: java arraylist
我有两种不同的对象arraylist
ArrayList<Buckets> parent; ArrayList<Buckets> child;
现在我想使用
child = new ArrayList<>(parent);
但是在此之后每当我对孩子进行任何更改时,父级arraylist也会更新。我怎样才能使孩子的arraylist独立。我检查了其他答案主要是使用集合,但它也没有在这里工作。有人可以帮助我吗?谢谢