Local Variable Type Inference in Java 10

Java is often criticized as being too verbose. One aspect contributing to this characterization is the requirement to specify every type explicitly, which leads to a lot of additional noise. A new way of declaring local variables with less clutter was given to us with JDK 10 and JEP 286: local variable type inference.

Localization Changes in Java 9

We use java.util.Locale to format dates, numbers, currency, and more. But in some circumstances, these formatted strings have changed with JDK 9, leading to a multitude of subtle (and sometimes not so subtle) bugs.

Nested Classes in Java

In object-oriented languages, a nested or inner class is a class that’s completely declared within another class. This allows us to combine classes that are logically bound together, to increase encapsulation, for more concise and maintainable code. Here’s a quick, non-deep-dive overview of the 4 types of nested classes.

Functional Programming With Java: Exception Handling

In my previous articles about functional programming, I’ve shown how to incorporate a more functional style into our Java code. But I’ve omitted a crucial topic: how to deal with exceptions.

Java Benchmarks with JMH

Almost every developer knows the phrase “premature optimization is the root of all evil”, coined by Donald Knuth in 1974. But how are we supposed to know what is worthy of being optimized?