import java.util.function.Function;
public interface Printable {
public String print(String s);
public static void main(String[] args) {
//Printable p = s -> "prefix "+s;
Function<String, String> fn = p -> p +" from lambda";
String result = fn.apply("test");
System.out.println(result);
}
}
What I mean is, fn.apply(“test”) seems unnecessary, since the only possible method is apply. So why not syntax like fn::(test) ?