Java 8 optional class | java optional class interview questions | java 8 interview | okay java

preview_player
Показать описание
Java 8 optional | optional class | optional class interview questions | java 8 interview | okay java
Java 8 Optional class
.isPresent()
.ifPresent()
.get()
.orElse()
.orElseGet()
orElse v/s orElseGet()
.orElseThrow()
.filter()
.map()
.flatMap()

What is optional in java 8 ?
Optional is Final class in Java 8
 to handle values as ‘available’ or ‘not available’ instead of checking null values.

What are the different ways to create an optional object

.isPresent()
Boolean function
Returns true if there is a value present, otherwise false.

.get()
If a value is present in this Optional, returns the value, otherwise throws NoSuchElementException.

. ifPresent(consumer)
if a value is present, it invokes the specified consumer with the value, otherwise does nothing.

. orElseThrow(supplier)
Returns the contained value, if present, otherwise throws an exception to be created by the provided supplier.

// orElseThrow

. filter(predicate)
If a value is present and the value matches a given predicate, it returns an Optional describing the value, otherwise returns an empty Optional.

// Filter - apply a predicate

1. Java 8 new features

2. Java 8 functional interface part

3. Java 8 functional interface coding

4. Functional Interface prior to Java 8

5. Default methods in interface

6. Default methods Diamond Problem in java 8

7. Java 8 lambda expression

8. Lambda expression variable scope interview questions

9. Java 8 predicate functional Interface

10. Java 8 function interface

11. Java 8 consumer functional interface

12. java 8 supplier functional interface

13. Java 8 method reference

14. Java 8 optional class

15. Java 8 stream pipeline flow

16. Java 8 stream api operations

17. create java 8 stream

18. stream api - create java 8 streams

19. java 8 stream api- range v/s rangeclosed

20. java 8 stream api - filter | collect

21. java 8 stream api - map function distinct | filter

22. java 8 stream api - flatmap

23. java 8 interview question - sort employee list using stream api function

24. java 8 interview question - built in functional interfaces in java

25. Create Immutable class in Java

26. what is a web service ?

27. Watch Introduction to Microservices 08.50 Minutes

28. Watch Microservices components in one video 20 Minutes

29. Watch How to Install Spring Tool Suite on Windows Machine

Subscribe and share okayjava
Рекомендации по теме
Комментарии
Автор

1. Java 8 new features

2. Java 8 functional interface part

3. Java 8 functional interface coding

4. Functional Interface prior to Java 8

5. Default methods in interface

6. Default methods Diamond Problem in java 8

7. Java 8 lambda expression

8. Lambda expression variable scope interview questions

9. Java 8 predicate functional Interface

10. Java 8 function interface

11. Java 8 consumer functional interface

12. java 8 supplier functional interface

13. Java 8 method reference

14. Java 8 optional class

15. Java 8 stream pipeline flow

16. Java 8 stream api operations

17. create java 8 stream

18. stream api - create java 8 streams

19. java 8 stream api- range v/s rangeclosed

20. java 8 stream api - filter | collect

21. java 8 stream api - map function distinct | filter

22. java 8 stream api - flatmap

23. java 8 interview question - sort employee list using stream api function

24. java 8 interview question - built in functional interfaces in java

25. Create Immutable class in Java

26. what is a web service ?

27. Watch Introduction to Microservices 08.50 Minutes

28. Watch Microservices components in one video 20 Minutes

29. Watch How to Install Spring Tool Suite on Windows Machine

Subscribe and share okayjava

okayjava
Автор

One of the best playlist for learning java8.Thank you so much.Learnt alot from your videos.keep uploading this kind of videos.

lakshmidevilakshmidevi
Автор

Very well exaplained... Best series on Java 8 features

chethanlvm
Автор

Very useful video. Thanks for good Explanation. Very Easy Explanation so that Those listening can easy understand
Both practically and theoretically. Before did not understand internal implementation of optional class. But you made it very carefully understood. Thanks you so much.

kirane
Автор

nice explanation ...1 of the best in utube

mowglishihtzutoy
Автор

I like your other videos . But, In this video Your explanation about or else and or else get is not good at all and you are not explaining the differences . Please when you explain, compare the difference very well. Please take this as a positive feed back to improve the content

cooldudev