Try as Expression in Java 8

Posted by & filed under Java.

I’ve been familiarising myself with the new Java 8 language features. It’s great how much easier it is to work around language limitations now that we have lambdas. One annoyance with Java is that try blocks cannot be used as expressions. We can do it with “if” conditionals using the ternary operator. String result =… Read more »