Maz*_*ion 7 java interface functional-interface
假设我有一个界面:
public interface Function {
double function (double input);
}
Run Code Online (Sandbox Code Playgroud)
现在,假设我在我的主类中的某个地方创建了这个接口的实例,
Function f = (x) -> x;
Run Code Online (Sandbox Code Playgroud)
如何以纯文本格式打印此功能?所以,有点像这样:
int f (double x) {return x}
Run Code Online (Sandbox Code Playgroud)
.toString在这上面运行Function打印就像Main$1@6d06d69c.我怎样才能获得此接口的java表示?