java.util.ArrayList类的clone()方法返回此ArrayList实例的浅拷贝(即元素本身不会被复制)。使用此方法,您可以将一个ArrayList的内容复制到另一个。示例import java.util.ArrayList; public class ArrayListDemo { public static void main(String args[]) { ArrayList arrlist1 = new ArrayList(); arrlist1.add(new StringBuilder("Learning-")); ArrayList arrlist2 = (ArrayList) arrlist1.clone(); StringBuilder strbuilder = arrlist1.get(0); strbuilder.append("list1, list2-both pointing to the same StringBuilder"); System.out.println("The 1st list prints: "); for (int i = ... 阅读更多