Since Java 8 many traditional use cases for abstract classes can be handled by interfaces with default methods. Often it's possible to express class functionality via single method. In such cases particular implementation of the interface can be even represented as lambda:
Since Java 8 many traditional use cases for abstract classes can be handled by interfaces with default methods. Often it's possible to express class functionality via single method. In such cases particular implementation of the interface can be even represented as lambda:
Now when one need to create implementation, it will look so: