生命如同寓言,其价值不在于长短,而在于内容—— 塞涅卡
1 2 3 4 5 6 7
| List<Integer> integerList = Arrays.stream(new int[]{1, 2, 3}).boxed().collect(Collectors.toList()); List<Integer> collect = Stream.concat(integerList.stream(), integerList.stream()).collect(Collectors.toList()); collect.forEach(System.out::print); System.out.println(); collect = Stream.of(integerList, integerList).flatMap(List::stream).collect(Collectors.toList()); collect.forEach(System.out::print); System.out.println();
|