Since the interface is a standard functional interface
This is a functional interface because it contains only one abstract method. This method takes one parameter and returns the value [void]
(Overrated for this question)
A lambda expression x -> { System.out.println(x); }can be rewritten as an anonymous class.
new Foo() {
@Override
public void bar(Object x) {
System.out.println(x);
}
}
doo, f, f.bar("baz");, "baz" x, .
public static void main(String[] args) {
Foo f = new Foo() {
@Override
public void bar(Object x) {
System.out.println(x);
}
};
f.bar("baz");
}