Posts Tagged: JDK 8

Scripting

Java, Map and Optional

Posted by & filed under , .

I do like the Optional class in Java — it is a long awaited elegant replacement for returning null whenever something isn’t there then relying on if( x != null ) checks or using ?: in the format (x == null) ? “foo” : “bar”. It works great also with the new Java stream classes […]

java code

Java … FunctionalInterface … WTF?

Posted by & filed under , .

If you’ve been doing “stuff” with Java 8 for a while I’m sure you’ve stepped into lambdas territory and the joys of succinct code it allows to be written. And if you are like me you probably found yourself using lambda’s everywhere you are confronted with a single-method interface. Which is allowed. In fact it’s […]

Java 8 — Map and the Unknown “Niceties”

Posted by & filed under , .

Despite Java 9 making its way into the real world nowadays, I see a lot of Java code out there still relying on the old-style Java 6-like syntax. And I’m not talking about the usage of lambda’s, stream’s and the likes, but rather some of the improvements Java 8 brought to existing classes in the […]