Annotation-->@FunctionalInterface
来源:互联网 发布:《电力网络》 编辑:程序博客网 时间:2024/05/29 16:22
@FunctionalInterface:
1、用来修饰接口Interface
2、修饰的接口有且仅有1个抽象方法 (public abstract )void() ;
案例源码如下,背下来:
package day8yue1;//接口中的静态方法要是有方法体的方法,不能是抽象方法@FunctionalInterfacepublic interface FunInterface {//java8新的接口特性static void foo(){System.out.println("foo方法");}//java8新的接口特性,服务于Lambad表达式default void bar(){System.out.println("bar");}// @FunctionalInterface 修饰的接口,必须有,而且仅有1个抽象方法 void test();//void test2();}
阅读全文
0 0
- Annotation-->@FunctionalInterface
- functionalInterface
- 函数式编程@FunctionalInterface
- java8函数式编程之一:@FunctionalInterface注解
- java8:@FunctionalInterface函数式接口注解
- java8 函数式接口(FunctionalInterface) [一]
- java8 函数式接口(FunctionalInterface) [二]
- JDK8 注解:函数式接口@FunctionalInterface
- 阅源-jdk8-FunctionalInterface注解package java.lang;
- annotation
- Annotation
- Annotation
- Annotation
- Annotation
- Annotation
- Annotation
- Annotation
- annotation
- 《机器学习实战》——决策树的构造及案例
- HTML
- 华为java面试题目
- c# 数组
- Oracle学习
- Annotation-->@FunctionalInterface
- ACM测试程序时,怎样从文件中读入,以及怎样将结果读出到文件(附带可运行代码)
- django的用户认证
- 欢迎使用CSDN-markdown编辑器
- 技术选型
- Tornado框架知识系列之四
- STM32串口多机通信(认识2)
- LintCode:二叉树的路径和
- 简单泛型实例