functional interfaces in java

Functional Interfaces

You’ve probably heard of a functional interface before, often in the same breath as lambdas. What are functional interfaces, and why are they used with lambdas?

Lambdas and functional interfaces go hand in hand in Java.

A functional interface is simply an interface that has a single abstract method. Before Java 8, they were referred to as SAM interfaces.

Why are these interfaces so important that they have their own term? Two reasons:

Continue reading