本文介绍了Java SE 8中新引入的lambda语言特性以及这些特性背后的设计思想.这些特性包括: lambda表达式(又被成为"闭包"或"匿名方法") 方法引用和构造方法引用 扩展的目标类型和类型推导 接口中的默认方法和静态方法 本文是对 Brian Goetz 的 State of the Lambda 一文的翻译. 背景 Java是一门面向对象编程语言.面向对象编程语言和函数式编程语言中的基本元素(Basic Values)都可以动态封装程序行为:面向对象编…
函数式接口详细定义 package java.lang; import java.lang.annotation.*; /** * An informative annotation type used to indicate that an interface * type declaration is intended to be a <i>functional interface</i> as * defined by the Java Language Specificat…