//标识为函数型接口,只能有一个方法
@FunctionalInterface
public interface FuncationTest {
void doSomething();
}
函数型作为参数
private void todo(FuncationTest funcationTest) {
funcationTest.doSomething();
}
调用这个方法
todo(() -> {
System.err.println(“todo something …”);
});