@Documented @Retention(value=RUNTIME) @Target(value=TYPE) public @interface FunctionalInterface
java.lang.Object
的公共方法,也不指望对接口的抽象方法计数以来任何实现的接口都将从
java.lang.Object
实施或其他地方。
注意功能接口的实例可以用lambda表达式,方法或构造函数创建参考参考。
如果一个类型用此注释类型注释,则需要编译器来生成一个错误消息:
然而,编译器会把任何接口满足功能接口作为一个功能接口,无论是否FunctionalInterface
注释出现在接口声明的定义。
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.