Is there a way to refer static method that returns void?
i've tried this
public Function<Runnable, Void> runner = Platform::runLater;
but it will say "bad return type, cannot convert void to java.lang.Void"
If your method has no return value, don't use the Function
interface.
Use Consumer<Runnable>
instead.
public Consumer<Runnable> runner = Platform::runLater;
It represents an operation that accepts a single input argument and returns no result.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments