Java

Java Optional

Optional was introduced in Java 8 and its primary objective is to prevent NullPointer exceptions in code. Consider it as wrapper/container object which may or may not hold a non-null value. One needs to unwrap/de-containerize it to get the actual content using methods provided by Optional itself. For example – method ‘isPresent‘ invoked on Optional …

Java Optional Read More »