Java 8

            coding with Eclipse :

            Lambda 表达式也称为闭包,是匿名类的简短形式。Lambda 表达式简化了单一抽象方法声明接口的使用,因此 lambda 表达式也称为功能接口Lambda 表达式也称为闭包,是匿名类的简短形式。Lambda 表达式简化了单一抽象方法声明接口的使用,因此 lambda 表达式也称为功能接口

                可以使用 lambda 表达式实现功能接口,无需创建类或匿名类。Lambda 表达式只能用于单一方法声明接口。

            Lambda 表达式旨在支持多核处理器架构,这种架构依赖于提供并行机制的软件,而该机制可以提高性能、减少完成时间。

            Lambda 表达式具有以下优点:

      • 简明的语法

      • 方法引用和构造函数引用

      • 相比于匿名类,减少了运行时开销

JSR 335 lambda 规范关键点:

A lambda expression is like a method: it provides a list of formal parameters and a body—an expression or block—expressed in terms of those parameters.

functional interface is an interface that has just one abstract method (aside from the methods of Object), and thus represents a single function contract.

The formal parameters of a lambda expression may have either declared types or inferred types. These styles cannot be mixed: it is not possible for a lambda expression to declare the types of some of its parameters but leave others to be inferred. Only parameters with declared types can have modifiers.

转载于:https://my.oschina.net/cedo/blog/315484

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值