Skip to content

Commit

Permalink
Fixed explanation toggle in streams lambdas
Browse files Browse the repository at this point in the history
  • Loading branch information
Luci-MG committed Dec 20, 2024
1 parent f3feff3 commit 49f5c82
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions docs/langdives/Java/StreamsLambdas.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ A method reference is a shorthand way of writing a lambda when a method already
names.forEach(System.out::println); // Method reference
```

???+ info "Explanation"
- `System.out::println` is a **method reference** to the `println()` method of `System.out`.
- It behaves just like the lambda `name -> System.out.println(name)` but is cleaner.
???+ info "Explanation"
- `System.out::println` is a **method reference** to the `println()` method of `System.out`.
- It behaves just like the lambda `name -> System.out.println(name)` but is cleaner.

Use **method references** when:

Expand Down

0 comments on commit 49f5c82

Please sign in to comment.