Suppose I have an interface:
public interface Function {
double function (double input);
}
Now, suppose I have created an instance of this interface somewhere in my main class,
Function f = (x) -> x;
How can I go about printing this function, in plain text? So, something a bit like this:
int f (double x) {return x}
Running a .toString
on this Function
prints something like Main$1@6d06d69c
. How can I go about getting the java representation of this interface?