I want to assign the reference to variable p:
Function<?, Void> p = System.out::println; // [1]
so that I can use it like:
p("Hello world"); // I wish `p` to behave exactly same as `System.out.println`
Expression [1] produce a compilation error, how to resolve it?
Exception in thread "main" java.lang.Error: Unresolved compilation problem:
The type of println(Object) from the type PrintStream is void, this is incompatible with the descriptor's return type: Void
If change Void to void the error becomes:
Exception in thread "main" java.lang.Error: Unresolved compilation problem: Syntax error, insert "Dimensions" to complete ReferenceType