Skip to content
This repository was archived by the owner on Feb 10, 2021. It is now read-only.

Commit f1c5262

Browse files
authored
Update readme.md
1 parent fa60e8e commit f1c5262

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lambdas/readme.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ In case you are calling some existing method inside the lambda, you can referenc
3838
### Best practices
3939
* use **lambdas instead of anonymous classes**
4040
* **avoid lambda parameter types**, unless it can improve code readability
41-
* **keep lambda expression as small** ( 1 line is the best option)
42-
* when creating a custom functional interface **always use `@FunctionalInterface` annotation**
41+
* **keep lambda expression small** (1 line is the best option)
42+
* **always use `@FunctionalInterface` annotation** for custom functional interfaces
4343
* **prefer standard predefined functional interfaces** (`java.util.function`)
4444
* create a **custom FI**, in case it has some **specific contract**, and you can **benefit from self-descriptive name** and **default methods**
4545
* **ALWAYS USE SPECIAL FI FOR PRIMITIVES** (e.g. `IntToDoubleFunction` instead of `Function<Integer, Double>`)

0 commit comments

Comments
 (0)