1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
|
String[] strArr = {"a", "b", "c"}; List<String> aList = Arrays.asList(strArr); Integer[] integerArr = {1, 2, 3}; List<Integer> bList = Arrays.asList(integerArr); int[] intArr = {1, 2, 3}; List<int[]> cList = Arrays.asList(intArr);
List<Integer> intList = Arrays.stream(arr).boxed().collect(Collectors.toList()); List<String> strList = Arrays.stream(strArr).collect(Collectors.toList());
String[] strArray = {"a", "b", "c"}; List< String> arrayList = new ArrayList<String>(strArray.length); Collections.addAll(arrayList, strArray);
|