Search code examples
javajava-8java-stream

Java 8 functional interface with no arguments and no return value


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

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


Solution

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