Welcome readers, Greetings for the day.

Photo by Vicky Summer on Unsplash

In this story, I’ll guide you through the use of the Optional class that was introduced in Java 8. Also will look, how to throw a custom exception when an Optional is empty.

Topics covered:

1. The purpose of Optional
2. Uses of Optional class API methods
3. Throw an exception when Optional is empty.

The purpose of the Optional is to provide a type-level solution. This means you can represent optional values instead of null references.

A container object which may or may not contain a non-null value. If a value is present…

Hello Readers, Greetings for the day.!

In this article, we will look at Hibernate caching and get an idea about first-level cache and second-level cache.

Let’s start as a noobie, what is caching?

In general, caching is a mechanism to store copies of data or files in such a manner so that they can be served quickly. In computer science caching is related to hardware or software component that stores data so that future requests for that data can be served faster; the data stored in a cache might be the result of an earlier computation or a copy of data stored elsewhere. — Wiki

Photo by Art Wall - Kittenprint on Unsplash

If we are…

Darshan Dalwadi

Trust your self and you will rock.!

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store