Lambda表达式的格式
public static void main(String[] args) { Thread thread = new Thread( () -> {System.out.println(" thread init");}); thread.start(); }
//(数据类型 参数)-> {前面的参数传递到这个方法体中}
()表示方法中的参数列表
-> 表示列表中的参数传递到方法体
{} 方法体
public static void main(String[] args) { Thread thread = new Thread( () -> {System.out.println(" thread init");}); thread.start(); }
//(数据类型 参数)-> {前面的参数传递到这个方法体中}
()表示方法中的参数列表
-> 表示列表中的参数传递到方法体
{} 方法体