An informative annotation type used to indicate that an interface type declaration is intended to be a <i> functional interface </i> as defined by Java Language Specification.
Conceptually, a functional interface has exactly one abstract method. Since {@linkplain java.lang.reflect.Method#isDefault() default methods} have an inplementation, they are not abstract. If an interface decalres an abstract mehod overriding one of the public methods of {@code java.lang.Object}, that also does <em>not</em> count toward the interface's abstract method count since any implementation of the interface will have an implementation from {@code java.lang.Ojbect} or elsewhere.
<p>Note that instances of functional interfaces can be created with lambda expressions, method references,or constractor references.
<p>If a type is annotated with this annotation type, compilers are required to generate an error message unless:
<ul>
<li>the type is an interface type and not an annotation type, enum, or class.
<li>The annotated type satisfies the requirements of a functional interface
</ul>
<p>How ever, the compiler will treat any interface meeting the definition of a functional interface as a functional interface regardless of whether or not a {@code FunctionalInterface} annotation is present on the interface declaration.
功能函数定义:
概念:有且只有一个抽象方法的接口
注意:
- 允许定义静态方法
- 允许定义默认方法
- 允许java.lang.Object中的public方法