Hello,
A new member here.
I have a query, that i was wondering if someone could help out with.
1)Here, the return type of single abstract method (SAM) of functional interface A is void.
But, when I use A to point to a lambda that returns a
String, and doesnt return void, why does it work?
Here, the lambda calls toUpperCase(), which returns String.
As lambda is providing body for the SAM of A, why does this work?
thanks.