Functional Java for Javas
Functional Java refers to the lambda expressions, functional interfaces and Stream API added in Java 8, along with the modern date-time and file I/O classes. Together they let you process data declaratively instead of writing manual loops. It sits in the Core Libraries stage and shapes how modern Java is written.
Stage: Core Libraries · Part of the Java roadmap · Last reviewed 19 November 2026
What to learn in Functional Java
- Write a lambda expression and match it to a functional interface such as Function or Predicate
- Build a stream pipeline with filter, map and collect
- Group records with Collectors.groupingBy and summarise each group
- Handle absent values with Optional instead of returning null
- Parse and format dates using LocalDate and DateTimeFormatter
- Read and write text files with the java.nio.file Files class
Functional Java interview questions
What is the difference between map and flatMap in Java streams?
map transforms each element into exactly one new element. flatMap transforms each element into a stream and then flattens those streams into one. Use flatMap when each item produces multiple results, for example turning a list of orders into a single stream of line items.
Are Java streams lazy, and what triggers execution?
Intermediate operations such as filter and map are lazy and only describe the pipeline. Nothing runs until a terminal operation such as collect, forEach or count is called. A stream can also be consumed only once, so reusing it throws an exception.
Where Functional Java fits in the Java roadmap
Functional Java belongs to the Core Libraries stage (intermediate level), which takes about 32 hours. Everyday APIs.