首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
社区首页 >问答首页 >不接受任何内容也不返回任何内容的函数接口

不接受任何内容也不返回任何内容的函数接口
EN

Stack Overflow用户
提问于 2014-05-31 00:03:52
回答 1查看 74.9K关注 0票数 163

JDK中是否有一个标准的函数接口,既不接受任何内容也不返回任何内容?我找不到。类似于以下内容:

代码语言:javascript
代码运行次数:0
运行
复制
@FunctionalInterface
interface Action {
  void execute();
}
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2014-05-31 00:09:27

Runnable怎么样:

代码语言:javascript
代码运行次数:0
运行
复制
@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();
}
票数 238
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/23958814

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档