Why Functional Interfaces in Java 8 have one Abstract Method?

后端 未结 3 1686
时光取名叫无心
时光取名叫无心 2020-11-28 11:13

As we know in Java 8, the concept of functional interfaces are introduced. A Functional Interface has one abstract method and several default or static methods

3条回答
  •  春和景丽
    2020-11-28 11:57

    Functional Interface lets us call an object as if it were a function, which lets us pass verbs(functions) around our program rather than nouns(objects). Implementations of Functional Interface perform a single well-defined action, as any method should, with a name like run, execute, perform, apply, or some other generic verb.[1]

    1. Functional Programming Patterns in Scala and Clojure.

提交回复
热议问题