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

Chapter 5. Recursion Techniques in Java 8

Recursion is a powerful functional programming technique that lends itself to more elegant and succinct solutions than an iterative approach. Recursion is the technique where a method, either directly or indirectly, calls itself. A lambda expression can also call itself recursively. The discussion in this chapter will focus on method recursion. However, keep in mind that the ideas and concepts apply equally to recursive lambda expressions.

In this chapter, we will:

  • Introduce recursion terminology
  • Contrast iterative and recursion techniques
  • Demonstrate recursive lambda expressions
  • Explore common recursion strategies
  • Provide guidance as to when to use recursion

Recursion is not new to Java 8. To illustrate recursion ...

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