Java - Optional Class Tutorial with Example

Veröffentlicht am: 19 April 2020
auf dem Kanal: Akhil Karun
1,425
27

Notes on how to use the Optional class in Java
https://www.oracle.com/technical-reso...

0:00 Introduction
0:17 Goodbye null checks!
0:56 Replacing null check with Optional
1:45 With Optional Lambdas
2:37 Another Example
5:07 When not to use Optional?
6:14 When to use Optional? - THUMB RULE
7:12 Summary Time

Key Ideas:
It is a class that encapsulates an optional value. You can also create classes using Optional.of(usb);
Wrap classes with Optional.
This wrapping unlocks streams functionality.
Use ifPresent instead of isPresent.


Oracle article link:
https://www.oracle.com/technical-reso...


Auf dieser Seite können Sie das Online-Video Java - Optional Class Tutorial with Example mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer Akhil Karun 19 April 2020 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 1,425 Mal angesehen und es wurde von 27 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!