Java
Lambda Expressions in Java
A lambda is a short way to write an implementation of a single method interface, so behaviour can be passed around like a value.
Lambda expressions, functional interfaces, method references and Optional.
4 notes
A lambda is a short way to write an implementation of a single method interface, so behaviour can be passed around like a value.
An interface with exactly one abstract method can be implemented by a lambda, and the standard library supplies the ones you need most.
When a lambda does nothing but call an existing method, a method reference says the same thing with less noise.
Optional makes absence part of the type, so a caller cannot forget that a value might not be there.