I have a function, which takes a function and string as arguments, I want to call this function with the string argument and return the result.
Something like this:
public static String mainFunc(Callable func, String s) {
return func.call(s); // Error
}
mainFunc(SomeObject::instanceMethod, s)
But as you can see it is not working. Please note that I don't necessarily need to use Callable, it can be any other interface.