All posts by

Daniel Zimmermann

expand_more

Optionals in Java 8 and how to use them

A person writing on a computer

Since the release of Java 8, NullPointerExceptions have been pretty common. Before Java 8, your code was probably full of “if statements” to check if a variable was null. Still, it was impossible to catch every NullPointerException out there. With Java 8, Oracle attempted to solve this issue. They didn’t