java函数式接口

java函数式接口,第1张

java函数接口

函数式接口:
    只有一个抽象方法的接口才是函数式接口;从Object类继承的抽象方法不算接口的拥有抽象方法。

官方文档对函数式接口的描述:

 Conceptually, a functional interface has exactly one abstract method.  Since {@linkplain java.lang.reflect.Method#isDefault() 
 default methods} have an implementation, they are not abstract.  If an interface declares an abstract method overriding one of the public methods of {@code java.lang.Object}, that also does not count toward the interface's abstract method count since any implementation of the interface will have an
 implementation from {@code java.lang.Object} or elsewhere.

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/zaji/5482356.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-12-12
下一篇 2022-12-12

发表评论

登录后才能评论

评论列表(0条)

保存