O'Reilly logo

Functional Programming in Java by Venkat Subramaniam

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

A Peek into the default Methods

In the design we explored in the previous section we used the new default methods. default methods are not intrinsically tied to lambda expressions or the functional style of programming. However, many of the convenience methods in collections would not have been possible without them.

Interface evolution is the key motivation behind default methods. The API defined in the early ’90s was a good idea back then, but for the platform to stay relevant it needs to evolve. The default methods provide a nondisruptive path for that. Moving forward, when we design with interfaces we’ll likely use default methods. Let’s examine their behavior and how they intermix with classes.

The Java compiler follows a few simple rules ...

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