31 How To Use Java 8 Optional Class?

Veröffentlicht am: 27 Januar 2022
auf dem Kanal: coderolls
32
0

#Java8Features #Optional

Example code can be found here: https://github.com/coderolls/java-8-f...

In this video, we will see the Optional class. The Optional class was introduced in Java 8.

Java 8 Optional class helps us deal with the NullPointerException in a better way.

In our day-to-day java programming, we use the if statement to do the null checks for the variable. But doing null checks using the if-else every single time is a tedious job to do. And as per the human tendency, there are great chances to forget to perform the null checks, which make our code error-prone.

To handle these situations, we got the Optional class in Java 8.

methods such as .ofNullable(), isPresent(), get(), orElse() helps us to deal with NullPointerException.

Watch this video to learn more about Java 8 Optional Class with some examples.

This video is part of Java 8 features full course. ▶️    • 01 How To Write Lambda Expressions In Java?  

GitHub Repository Link: https://github.com/coderolls/java-8-f...

00:00 Introduction To Optional Class
01:19 How To Use Optional Class in Java?

Buy me a coffee ☕: https://www.buymeacoffee.com/gauravku...

This is video is uploaded by codeRolls. Visit us at https://coderolls.com

Subscribe to my YouTube Channel
   / @coderolls  

Follow us on:

Twitter ►   / coderolls  
Facebook ►   / coderolls  
Instagram ►   / coderolls  
Pinterest ►   / coderolls  


Auf dieser Seite können Sie das Online-Video 31 How To Use Java 8 Optional Class? mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer coderolls 27 Januar 2022 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 32 Mal angesehen und es wurde von 0 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!