function界面什么都不带,什么都不返回
JDK中是否有标准的function接口,什么都不带,什么都不返回? 我找不到一个。 类似于以下内容:
@FunctionalInterface interface Action { void execute(); }
Runnable怎么样:
@FunctionalInterface public interface Runnable { /** * When an object implementing interface
Runnable
is used * to create a thread, starting the thread causes the object's *run
method to be called in that separately executing * thread. ** The general contract of the method
run
is that it may * take any action whatsoever. * * @see java.lang.Thread#run() */ public abstract void run(); }