Tag: java optional
NullPointerException in Java
In this article, we will talk about the infamous NullPointerException Java Error and how to solve it. 1. What is Null in Java? The null is a keyword and it means that an object’s address points to nothing. Moreover, all objects in Java are null by default unless we initialize them. Finally, a primitive can…
Java 8 Optional
In this article, we’ll talk about Java 8 Optional class and how you can take full advantage, through detailed examples. 1. What is Optional in Java? Optional is a wrapper class that was introduced in Java 8, in order to have a more elegant way to handle null values. Also Optional works in conjunction with…