Concept of functional interface

前端 未结 4 1209
感动是毒
感动是毒 2021-01-06 08:23

When I\'m shooting a glance at lambda expressions, the book touches on a functional interface that has only one abstract method. My issue addresses on that quiz que

4条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-01-06 09:03

    interface SmartAdder overloads, not overrides interface Adder. That's because the name is the same name, but parameters types are different. Therefore, it has 2 functions. To be a functional interface it needs to have only one function.

    ==> Only interface Adder is a functional interface.

提交回复
热议问题