Optional Class in Java 8 - Avoid Null Pointer Exception | Java 8 Features | Crash Course ✅

preview_player
Показать описание
Java introduced a new class Optional in JDK 8. It is a public final class and is used to deal with NullPointerException in Java applications.

The purpose of the class is to provide a type-level solution for representing optional values instead of using null references.

Advantages of Java 8 Optional
- Null checks are not required.
- No more NullPointerException at run-time.
- We can develop a clean and neat APIs.
- No more Boilerplate code

#java #java8 #javaguides
Рекомендации по теме
Комментарии
Автор

Sir the way you also get into source code of Java method helps a lot to understand functionality more clearly.
.Request you to please make video on completablefuture also

сойка-ий
Автор

Beautifully explained. Understood lot of stuff.

meenajadhav
Автор

Super bro. But, Optional didnt solve tha multiple null check in single condition though. We could use it only for compound operation right?

jagadeesh
Автор

Null Pointer "Crash" course 😜

sandyj