Lambda表达式的格式

    public static void main(String[] args) {
        Thread thread = new Thread(  () -> {System.out.println(" thread init");});

        thread.start();

    }
  //(数据类型 参数)-> {前面的参数传递到这个方法体中}

()表示方法中的参数列表

-> 表示列表中的参数传递到方法体

{} 方法体

posted @ 2020-12-16 22:55  SimonShixinlong  阅读(154)  评论(0)    收藏  举报