Skip to main content

9 docs tagged with "functional-programming"

View all tags

Collectors

Java's built-in Collector implementations — toList, groupingBy, partitioningBy, joining, toMap, counting, and how to build custom collectors.

Functional Interfaces

What functional interfaces are, the built-in types (Function, Predicate, Consumer, Supplier), and how to compose them.

Lambdas

Lambda expressions in Java — syntax, effectively-final capture, `this` behavior, and how they relate to functional interfaces.

Method References

The four kinds of method references in Java — static, bound instance, unbound instance, and constructor — and when to prefer them over lambdas.

Optional (Java 8+)

Java's Optional container type — what it is, when it genuinely clarifies code, and the common anti-patterns that make it worse than a null check.

Optional Deep Dive

How to use Optional correctly — creation, retrieval patterns, chaining, and the anti-patterns that make Optional worse than null.

Parallel Streams

When parallel streams improve throughput, when they hurt, and how the ForkJoin common pool governs parallel execution.

Streams API

How Java streams work — pipeline anatomy, lazy evaluation, intermediate vs. terminal operations, and common pitfalls.