Skip to content

Commit afd3d42

Browse files
hanxy17CarpenterLee
authored andcommitted
修正拼写错误
1 parent d3fe44c commit afd3d42

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

5-Streams API(II).md

+1-1
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ HashSet<String> hashSet = stream.collect(Collectors.toCollection(HashSet::new));
132132
```Java
133133
// 使用toMap()统计学生GPA
134134
Map<Student, Double> studentToGPA =
135-
students.stream().collect(Collectors.toMap(Functions.identity(),// 如何生成key
135+
students.stream().collect(Collectors.toMap(Function.identity(),// 如何生成key
136136
student -> computeGPA(student)));// 如何生成value
137137
```
138138
情况2:使用`partitioningBy()`生成的收集器,这种情况适用于将`Stream`中的元素依据某个二值逻辑(满足条件,或不满足)分成互补相交的两部分,比如男女性别、成绩及格与否等。下列代码展示将学生分成成绩及格或不及格的两部分。

0 commit comments

Comments
 (0)