java Lambd牛彩源码下载a表达式心得

java Lambda表达牛彩源码下载【征途源码论坛zhengtuwl.com】联系方式:QQ:2747044651式只能用来简化仅包含一个public方法的接口的创建
括号形式
只能是接口
否则报:Target type of a lambda conversion must be an interface
只能有一个public方法
否则报:Multiple non-overriding abstract methods found AInterface
testA((int i, int j) -> {});参数要与接口一致
public class Go {
public static void main(String a[]) {
//正确示范
testA((int i, int j) -> {});
//错误示范:Multiple non-overriding abstract methods found xxx;只能有一个public方法
testB((int i, int j) -> {});
//错误示范:Target type of a lambda conversion must be an interface;只能是接口
testC((int i, int j) -> {});
}

public static void testA(AInterface t) {    }
public static void testC(CInterface t) {}
public static vo

猜你喜欢

转载自blog.51cto.com/13945048/2166033