📜  复制arraylist java代码示例

📅  最后修改于: 2022-03-11 14:52:30.988000             🧑  作者: Mango

代码示例1
List original=new ArrayList<>();
//insert elements
List copy=new ArrayList<>(original);//create copy here
System.out.println(copy.equals(original));//true because the copy has the same elements
System.out.println(copy==original);//false because it is another List