Simple Java 8 Lambdas is a collection of code examples which can help developers quickly start programming lambda expressions in Java 8. Each post illustrates one feature/issue which normally can be completed in 5 minutes. The goal is to make the lambda expression learning simple.
All code used can be downloaded from Github.
- What is Stream?
- How Functional Interface Works?
- Create a Stream
- Transform Stream
- Reduce Stream
- Optional Type
- Primitive Type Streams
3. Goodies of Using Lambdas
- How to write a counter in one line of code?
- Enhanced For-loop vs. forEach()
- How to convert a Stream to an array?
- How to concat 2 Streams?
- How to retrieve a List from a Stream?
- Why Stream.max(Integer::max) compiles?
- Return a Stream vs. Return a Collection
4. Other Features of Java 8