// copying lists need to have the destination size to be // the same or bigger than the source size import java.util.ArrayList; import java.util.Collections; import java.util.Vector; public class g { public static void main(String[] args) { ArrayList al = new ArrayList(); al.add("1"); al.add("2"); al.add("3"); al.add("4"); al.add("5"); Vector v = new Vector(); for(String s:al){v.add(null);} System.out.println(v); Collections.copy(v, al); System.out.println(v); } } ___________________________________________________________________________________ // backup before using the set command import java.util.*; public class r { public static void main(String[] a) { ArrayList al = new ArrayList(); al.add("1"); al.add("2"); al.add("3"); System.out.println(al); Vector v = new Vector(); for (String s:al) {v.add(null);} Collections.copy(v, al); al.set(0, "4"); al.set(1, "5"); al.set(2, "6"); System.out.println(al); System.out.println("But Still you have the old ones ---------"); System.out.println(v); } } ___________________________________________________________________________________