We used several functional interfaces in the previous examples. In this section, we will examine in more detail how they are created and illustrate a number of predefined functional interfaces available for immediate use in Java 8.
As mentioned earlier, a functional interface is an interface that has one and only one abstract method. It may have zero or more default methods. Since the interface has only one abstract method, the system is able to know which method to match to a lambda expression. This abstract method is called the functional method.
IntegerConcatenation interface is duplicated here as an example. Note the use of the
@FunctionalInterface annotation. While not required, ...