标签:out pre rgs oid 简化 ati ike ring system
public class hh {
public static void main(String[]args)
{
ilike like =(a)->{
System.out.println("ad"+a);
};
like.lambda(2);
**只带有一个参数可以简化为:**
ilke like =a->{
System.out.println("ad"+a);
};
只带有一个参数和一行代码可简化为:
ilke like =a->System.out.println("ad"+a);
}
}
interface ilike{
void lambda(int a);
}
class like implements ilike{
public void lambda(int a)
{
System.out.println("i like"+"-->"+a);
}
}
标签:out pre rgs oid 简化 ati ike ring system
原文地址:https://blog.51cto.com/14437184/2427423