Copy constructor of Array List
问题 I just read about deep copy of ArrayList, that people think new ArrayList<>(originalList); will create a shallow copy. And I wrote a small demo ArrayList<String> originalNameList = new ArrayList<>(Arrays.asList("Anna", "Betty", "Chris")); List<String> copyNameList1=originalNameList; List<String> copyNameList2= new ArrayList<>(originalNameList); originalNameList.add("Duke"); copyNameList1.add("Ellen"); copyNameList1.set(1,"Bill"); copyNameList2.set(0,"Andy"); System.out.println(