Skip to content

Commit bde6600

Browse files
committed
Published with https://stackedit.io/
1 parent 8e3e83b commit bde6600

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

29.Java8之Stream.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,5 @@ rs.sort(new Comparator<Integer>() {
2626
不难看出,相比JavaScript,Java代码显得笨重且臃肿。Oracle明显也注意到了这一点,于是在Java8中加入了对集合相应的支持。Java8并未在原有的集合类中直接支持filter、map等操作的,而是引入了一个新的类:**Stream**
2727
```
2828
List<Integer> list = Arrays.asList(new Integer[]{0, 1, 2, 3, 4, 5, 6, 7, 8, 9});
29-
3029
List<Integer> rs = list.stream().filter(i -> i % 2 == 0).map(i -> i * i).sorted((x,y) -> y - x).collect(Collectors.toList());
3130
```

0 commit comments

Comments
 (0)