1. What is the difference between
i. List<Integer> list1 = new ArrayList<Integer>(Arrays.asList(ia)); ii. List<Integer> list2 = Arrays.asList(ia);
i. new ArrayList<Integer>(Arrays.asList(ia))
ArrayList is an independent copy of the original one. Arrays.asList, it is used only during the construction of the new ArrayList and is garbage-collected afterwards.ii. Arrays.asList(ia)
ia and creates a wrapper that implements List<Integer>, which makes the original array as a list. ArrayList -- ArrayLists have their own, internal array, which they are able to resize.
2.
原文:http://www.cnblogs.com/joycelee/p/5792235.html