JDK中是否有一个标准的函数接口,既不接受任何内容也不返回任何内容?我找不到。类似于以下内容:
@FunctionalInterface
interface Action {
void execute();
}
发布于 2014-05-30 16:09:27
Runnable怎么样:
@FunctionalInterface
public interface Runnable {
/**
* When an object implementing interface <code>Runnable</code> is used
* to create a thread, starting the thread causes the object's
* <code>run</code> method to be called in that separately executing
* thread.
* <p>
* The general contract of the method <code>run</code> is that it may
* take any action whatsoever.
*
* @see java.lang.Thread#run()
*/
public abstract void run();
}
https://stackoverflow.com/questions/23958814
复制相似问题