Final defenders

Aleksey Shipilev aleksey.shipilev at oracle.com
Tue Aug 7 11:16:35 PDT 2012


On 08/07/2012 09:55 PM, "Zdeněk Troníček" wrote:
> StatefulOp should be declared as abstract class, not interface.
> Concerning the final methods in interfaces, I view default methods as a
> means for API evolution and from this point of view, they do not seem
> particularly useful.

Yes, in the Java 5-7 they indeed should be abstract base classes. But in
this case, lambdas requiring functional interfaces. Making StatefulOp an
abstract class will prohibit making a StatefulOp-typed lambda.

Maybe the answer lies in allowing lambdas implement abstract classes,
but that would be MUCH more mess than allowing final defenders.

-Aleksey.



More information about the lambda-dev mailing list