Type inference for a lambda expression comes from the target type, that is, when you write something like this, for example:
() -> "";
This is valid Supplier(for you, not the compiler), but what if I have a type declared as follows:
static interface Producer<T> {
T produce();
}
, Producer Supplier. , @FunctionalInterface ( ), .
JLS ( , - , , , )