= 8 I can determine it myself, for example. in this way: @FunctionalInterface int...">

"Function" with no arguments and no return type (void) in Java> = 8

I can determine it myself, for example. in this way:

@FunctionalInterface interface EmptyEmptyFunction { void apply(); } 

and then use it like this:

  EmptyEmptyFunction m = () -> {System.out.println("Hello World - Java 8!");}; m.apply(); 

My question is: is there a built-in type in the JDK like
EmptyEmptyFunction , or should I define EmptyEmptyFunction
myself (as I already did)?

There are many functional interfaces.

http://docs.oracle.com/javase/8/docs/api/java/util/function/package-summary.html

but I can’t find one that has exactly
same "signature" as my EmptyEmptyFunction .

+7
java java-8
Jan 15 '15 at 21:27
source share

No one has answered this question yet.

See similar questions:

85
functional interface that accepts nothing and returns nothing
58
Java 8 functional interface with no arguments and no return value
9
Java8 functional interface for callback processing
four
Function pointers as parameters in Java 8
3
Is there a way to pass my Java function to a try-catch function?
one
Pass static methods in Java

or similar:

6170
Is Java pass-by-reference or pass-by-value?
3799
How do I read / convert an InputStream to a string in Java?
3324
How to generate random integers in a specific range in Java?
3073
How to efficiently iterate over each entry on a Java map?
3044
Creating a memory leak using Java
2956
What is the difference between public, secure, batch, and private in Java?
2936
When to use LinkedList over ArrayList in Java?
2853
How to convert String to int in Java?
2248
Is the finally block always executable in Java?
6
Do you have a list of Java 8 functional interfaces (not the ones listed in java.util.function)?



All Articles