@Documented @Retention(value=RUNTIME) @Target(value=TYPE) public @interface FunctionalInterface
java.lang.Object
,也不会向接口的抽象方法计数统计以来的接口的任何实施都会有一个实现从java.lang.Object
或其他地方。
请注意,可以使用lambda表达式,方法引用或构造函数引用创建函数接口的实例。
如果使用此注释类型注释类型,则编译器需要生成错误消息,除非:
但是,编译器会将符合功能接口定义的任何接口视为功能接口,而不管FunctionalInterface
声明是否存在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.