Quick Tips: The Optional class in Java — Avoiding NullPointerException

Whether you are a beginner Java programmer or an experienced programmer, you have probably come across the Exception — NullPointerException.

In this quick tip, we’ll see how we can prevent this runtime exception from causing problems that could have been avoided.