functional interface

An interface with exactly one abstract method, such as Runnable, Supplier or Predicate, which a lambda or method reference can implement.

In more detail

The standard java.util.function package supplies common shapes: Supplier produces a value, Predicate tests one, Function transforms one and Consumer accepts one. Stream operations, Optional and CompletableFuture all take functional interfaces as parameters.

Related terms

Taught in

References

Certification courses