4 pages matching "Java"

T The Optional anti-patterns in Java

September 27, 2019 — 6 Min Read

Traditionally, Java programs have returned null as a way to represent that a value isn’t present. The version 8 of the SDK includes a new class which was made specifically to manage missing values.

I won’t describe the details of the Optional class, but very briefly it’s a container object which may or may not contain a non-null value. Therefore, it is possible to manipulate null values as if they were normal instances without necessarily having to perform a null check at every step.

In this article, I’m going to talk about experiences I gathered while working with Java and describe some anti-patterns I’ve seen about such class.


U Use Android SDK Manager with Java 11

June 9, 2019 — 2 Min Read

Since with the release 11 some deprecated packages used by the Android SDK were removed, it’s not yet possible to run it with the latest Java versions. As a workaround it’s possible to download the required classes separately and add them to the classpath, or install the latest supported version, java 1.8. This latter approach is the recommended one.


U Uninstall older versions of Java from macOS

February 11, 2019 — 1 Min Read

Sometimes it happens that after installing different versions of Java you want to remove the old/unused ones: in this brief tutorial we’ll see how to list all the installed versions and remove the one that are not required anymore from macOS.