Optional in Java 8: Why and When to use?

preview_player
Показать описание
#Optional #Java8
In this video, we are going to understand the need for java 8 Optional class and with an example, we will see when and how to use it to make the best of it.

-------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------
Рекомендации по теме
Комментарии
Автор

A good explanation. Thank you. The audio could have been a bit better. Please check.,

raghavanaliassaravananm
Автор

Why should I prefer Optional, when for a single null check I can do my work. In optional we have to use isPresent method then get value. Also of method doesn't handle null check. What's the point to use optional?

shawkishor
Автор

Please use simple Java program initial what ever used program again we need to see another video for how that program works

Автор

please add name() method in the enum Make as you are using name() in the video,

sudheery
Автор

Is having an instance variable of Optional type a good practice?

vinitpatil
Автор

This may be clean code than the old way . But seems too complicated

bibinchorickanpara