Last active
July 17, 2022 18:53
-
-
Save dlhartveld/5056695 to your computer and use it in GitHub Desktop.
Example Java 8 lambda expression: concatenation of two strings. The first version explicitly defines types and a method body. The second version omits these. It uses implicit typing for its parameters, and lacks the return statement.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
java.util.function.BiFunction<String, String, String> concat1 | |
= (String s, String t) -> { | |
return s + t; | |
}; | |
java.util.function.BiFunction<String, String, String> concat2 | |
= (s, t) -> s + t; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment