函数式接口:
只有一个抽象方法的接口才是函数式接口;从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.
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)