读《Java 8 函数式编程》

来源:互联网 发布:javascript 获取位置 编辑:程序博客网 时间:2024/06/04 18:21


非常薄的本

Java 8 中的函数式编程就是 Lambda 表达式,与我认为的函数式编程差别好大。

Runable noArguments = () -> System.out.println("Hello World");

ActionListener oneArgument = event -> System.out.println("Hello World");

Runable multiStatement = () -> {
    System.out.println("Hello World");
}

BinaryOperator<Long> add = (x, y) -> x + y;

BinaryOperator<Long> addExplicit = (Long x, Long y) -> x + y;

元素的排序,无方法名
转换值

读了此书没明白,什么是函数式编程,没明白怎么使用 Lambda。不会解答书中的问题。嗯
基本上等于没读。再看看别的吧。希望以后能理解多一些。

相关:
Lambda 表达式有何用处?如何使用?python
https://www.zhihu.com/question/20125256
JAVA
http://blog.csdn.net/ioriogami/article/details/12782141/
http://blog.csdn.net/renfufei/article/details/24600507/

Lambda 内部类:
http://blog.csdn.net/u013074999/article/details/46765307