Tag Archives: functional programming

Java 8+ Functional Programming :: Collections & Streams (2)

Structure of Java Stream Operations Any Java Stream operation has to have three components to make it work: a source one or more intermediate operations terminal operation Source –> Intermediate Operation 1 –> Intermediate Operation 2 –> … –> Terminal … Continue reading

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

Java 8+ Functional Programming :: Collections & Streams (1)

The Concept of a Collection A collection represents a group of objects, known as its elements.   The Collection Interface JDK 9 defines this interface as follows: public interface Collection extends Iterable { int size(); boolean isEmpty(); boolean contains(Object o); … Continue reading

Posted in functional interface, functional programming, java stream, lambda, lambda expression | 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