你以后的语法可能与一个小帮手功能,其转换
Runnable成
Action<Void, Void>(你可以将它放在
Action为例):
public static Action<Void, Void> action(Runnable runnable) { return (v) -> { runnable.run(); return null; };}// Somewhere else in your pre Action<Void, Void> action = action(() -> System.out.println("foo"));


