Category: Lambda Expressions

A Little Lazy Lambda Tutorial

Everyone is a bit lazy, so why not our code? Lambda expressions in Java 8 allow us to make our code that bit more lazy. In this short post I will cover how using Lambda expressions can make code more lazy. If you have not used Lambda expressions before have a look at my some ...

Common Fork Join Pool and Streams

In my post Dipping into Java 8 Streams a comment was added that I should explain what the Common Fork Join Pool is and how it is linked to parallel streams. Honestly I had never heard of it so I set out on my quest to find the answer somewhere on the internet and make ...

Java 8 Streams

Streams are another feature that were added with Java 8. It provides a different way of performing operations on a Collection. Rather than implementing how to perform an operation on a Collection you instead define what you want to come out of it, which follows the Functional Programming paradigm that was made available with Java ...

Method::reference

Method references are a feature of Java 8. They are effectively a subset of Lambda expressions because if a Lambda expression can be used then it might be possible to use a method reference, but not always. They can only be used to call a singular method, which obviously reduces the possible places they can ...

Which for loop?

Java 8 has introduced another type of for loop. This gives us the third way to use them. You would think that releasing another way to use the loop would suggest that it must be better than the others. But that is not the case, each one has subtle differences meaning you should have a ...

A Little Lambda Tutorial

Lambda expressions are thought to be one of the biggest features in the release of Java 8 as they allow a more functional approach to Java programming. This is something that wasn't built into Java in previous versions. Java follows the Object-Oriented programming paradigm which uses object which can store data in fields and manipulate ...