Monthly Archives: July 2018

Java 8+ Functional Programming :: Class Optional<T>

https://docs.oracle.com/javase/8/docs/api/java/util/Optional.html public final class Optional extends Object Optional is a container object used to contain not-null objects. Optional object is used to represent null with absent value. This class has various utility methods to facilitate code to handle values as … Continue reading

Posted in class optional | Tagged | Leave a comment

Java 8+ Functional Programming :: Method References

You use lambda expressions to create anonymous methods. Sometimes, a lambda expression does nothing but call an existing method. In those cases, it’s often clearer to refer to the existing method by name. References are a subset of lambda expressions, … Continue reading

Posted in functional programming, lambda expression, Method References | Tagged , , | Leave a comment

Java 8+ Functional Programming :: Default Functional Interfaces (some examples)

Functional interfaces provide target types for lambda expressions and method references. Package – java.util.function. https://docs.oracle.com/javase/8/docs/api/java/util/function/package-summary.html The interfaces in this package are general purpose functional interfaces used by the JDK, and are available to be used by user code as well. … Continue reading

Posted in default method, functional interface, functional programming, lambda, lambda expression | Tagged , , , , | Leave a comment

Java 8+ Functional Programming :: Default Methods

Default methods enable developers to add new functionalities to interfaces without breaking the existing implementation of these interfaces. Default methods are implicitly public. It provides flexibility to allow interface define implementation which will use as default in the situation where … Continue reading

Posted in default method, functional interface, functional programming, lambda, lambda expression | Tagged , , , , | Leave a comment

Java 8+ Functional Programming :: Functional Interfaces and Lambda Expressions

A functional interface is an interface that contains only one abstract method. Lambda expression can be used to represent the instance of a functional interface. Any interface with a single abstract method is a functional interface, and its implementation may … Continue reading

Posted in functional interface, functional programming, lambda, lambda expression | Tagged , , , | Leave a comment