Java 8功能接口,没有参数,也没有返回值 [英] Java 8 functional interface with no arguments and no return value

查看:1043
本文介绍了Java 8功能接口,没有参数,也没有返回值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么是Java 8功能接口,什么是什么都没有,什么也没有返回?

What is the Java 8 functional interface for a method that takes nothing and returns nothing?

即相当于C#无参数行动 void 返回类型?

I.e., the equivalent to to the C# parameterless Action with void return type?

推荐答案

如果我理解正确,你想要一个带方法的函数接口 void米()。在这种情况下,您只需使用 Runnable

If I understand correctly you want a functional interface with a method void m(). In which case you can simply use a Runnable.

这篇关于Java 8功能接口,没有参数,也没有返回值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆