Skip to content

Commit eb3c7e5

Browse files
committed
[doc fix]修正 java 8 新特性中 Comparator 接口示例代码变量名的错误
1 parent 7d69842 commit eb3c7e5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

docs/java/new-features/java8-common-new-features.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,8 @@ public int compare(Integer o1, Integer o2) {
142142
//Lambda
143143
Collections.sort(strings, (Integer o1, Integer o2) -> o1 - o2);
144144
//分解开
145-
Comparator<Integer> comperator = (Integer o1, Integer o2) -> o1 - o2;
146-
Collections.sort(strings, comperator);
145+
Comparator<Integer> comparator = (Integer o1, Integer o2) -> o1 - o2;
146+
Collections.sort(strings, comparator);
147147
```
148148

149149
**3.`Listener` 接口**

0 commit comments

Comments
 (0)