Chapter 17: Functional-Style Programming
As you probably know, Java is not a purely functional programming language like Haskell, but starting with version 8, Java has added some functional-style support. The effort of adding this support was a success and functional-style code was widely adopted by developers and companies. Functional-style programming sustains code that is more understandable, maintainable, and testable. However, writing Java code in the functional style requires serious knowledge of lambdas, the stream API, Optional
, functional interfaces, and so on. All these functional programming topics can be interview topics as well and, in this chapter, we will cover some of the hot questions that are mandatory to know for passing a regular Java interview. Our agenda contains the following topics:
- Java functional-style programming in a nutshell
- Questions and coding challenges
Let's get started!