Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit6afcb08

Browse files
committed
Use List.sort instead of Collections.sort
1 parent7fa21e2 commit6afcb08

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

‎README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ Collections.sort(names, (String a, String b) -> b.compareTo(a));
108108
For one line method bodies you can skip both the braces`{}` and the`return` keyword. But it gets even more shorter:
109109

110110
```java
111-
Collections.sort(names,(a, b)-> b.compareTo(a));
111+
names.sort((a, b)-> b.compareTo(a));
112112
```
113113

114114
The java compiler is aware of the parameter types so you can skip them as well. Let's dive deeper into how lambda expressions can be used in the wild.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp