首页 > 编程语言 > 详细

Java8 Lumbda表达式 初步

时间:2015-11-18 14:06:55      阅读:415      评论:0      收藏:0      [点我收藏+]

Java8 Lumbda表达式 初步

package com.stono.test;
import java.util.function.BinaryOperator;
public class Test001 {
    public static void main(String[] args) {
        Runnable r = () -> System.out.println("hello");
        r.run();
        Runnable r2 = () -> {
            System.out.println("1");
            System.out.println("2");
        };
        r2.run();
        BinaryOperator<Long> b = (x, y) -> x + y;
        System.out.println(b);
        Long long1 = b.apply(1l, 2l);
        System.out.println(long1);
    }
}

        // btnNewButton.addActionListener(event -> System.out.println("button Click"));
        ActionListener actionListener = event -> System.out.println("button Click2");
        btnNewButton.addActionListener(actionListener);

 

Java8 Lumbda表达式 初步

原文:http://www.cnblogs.com/stono/p/4974101.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!