O'Reilly logo

Learning Java Functional Programming by Richard M Reese

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Default methods and functions

Default methods can be added to interfaces. They permit existing interfaces to be expanded to include new methods without breaking the older code. It is the default method of an interface that has an implementation. For example, consider a class that implements an interface, and then later a default method is added to the interface. The class has to implement all of the interfaces' abstract methods or the class will be abstract. However, since a default method is not abstract and has an implementation, it does not affect the class.

The addition of functions to Java suggests the need to incorporate their use with older classes and interfaces. After all, it is desirable to take advantage of existing code when possible ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required