Java Functional Programming : This Java Programming Trick Will Save You Hours

Izzat Arramsyah
2 min readSep 24, 2024

LAMDA EXPRESSION

Lambda was introduced in Java 8, providing us with a clear and concise way to implement a single-method interface using Lambda Expressions. Lambda Expressions are useful for working with Collections, especially for filtering, mapping, and iterating over data

Hello World
Good morning

As we saw in the previous example, without using Lambda Expressions, we need to implement many interface methods. However, by using Lambda Expressions, we can treat them as method arguments. To implement a method with a Lambda Expression, you can use the syntax (parameters) -> expression if the method has parameters or () -> expression if the method has no parameters.

METHOD REFERENCE

It is a shorthand notation for lambda expressions to call a method using the :: notation.

--

--

No responses yet