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

  Рет қаралды 13,670

okay java

okay java

Күн бұрын

Java 8 optional | optional class | optional class interview questions | java 8 interview | okay java
Java 8 Optional class
Optional.empty()
Optional.of()
Optional.ofNullable()
.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
Optional.empty()
Optional.of()
Optional.ofNullable()
Optional.of() v/s Optional.ofNullable()
What is difference b/w Optional.of() and Optional.ofNullable() ?
Optional.of does not handle the "null" value , it gives null pointer exception.
.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.
opStr2.ifPresent(s -> System.out.println(s.toUpperCase()));
. orElseThrow(supplier)
Returns the contained value, if present, otherwise throws an exception to be created by the provided supplier.
// orElseThrow
Optional < Integer > item = Optional.empty();
. 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
Optional Integer age = Optional.of(20);
int a = age.filter(n -> n > 18).get();
System.out.println(a);
1. Java 8 new features
• Java 8 features | okay...
2. Java 8 functional interface part
• Java 8 functional inte...
3. Java 8 functional interface coding
• Java 8 functional inte...
4. Functional Interface prior to Java 8
• Functional Interface p...
5. Default methods in interface
• Default methods in int...
6. Default methods Diamond Problem in java 8
• Default methods Diamon...
7. Java 8 lambda expression
• Java 8 lambda expressi...
8. Lambda expression variable scope interview questions
• Lambda expression vari...
9. Java 8 predicate functional Interface
• Java 8 predicate funct...
10. Java 8 function interface
• Java 8 function interf...
11. Java 8 consumer functional interface
• Java 8 consumer functi...
12. java 8 supplier functional interface
• java 8 supplier functi...
13. Java 8 method reference
• Java 8 method referenc...
14. Java 8 optional class
• Java 8 optional class ...
15. Java 8 stream pipeline flow
• Java 8 stream pipeline...
16. Java 8 stream api operations
• Java 8 stream api oper...
17. create java 8 stream
• create java 8 steam | ...
18. stream api - create java 8 streams
• java 8 stream stream a...
19. java 8 stream api- range v/s rangeclosed
• java 8 stream api | ra...
20. java 8 stream api - filter | collect
• java 8 stream api | fi...
21. java 8 stream api - map function distinct | filter
• java 8 stream api | m...
22. java 8 stream api - flatmap
• java 8 stream api | fl...
23. java 8 interview question - sort employee list using stream api function
• java 8 interview quest...
24. java 8 interview question - built in functional interfaces in java
• java 8 interview quest...
25. Create Immutable class in Java
• Create Immutable class...
26. what is a web service ?
• what is a web service ...
27. Watch Introduction to Microservices 08.50 Minutes
• okay java | introducti...
28. Watch Microservices components in one video 20 Minutes
• okayjava | microservic...
29. Watch How to Install Spring Tool Suite on Windows Machine
• okay java | install sp...
Subscribe and share okayjava
www.youtube.co...

Пікірлер: 18
@okayjava
@okayjava 3 жыл бұрын
1. Java 8 new features kzbin.info/www/bejne/nZjLnIuvrdGfhKc 2. Java 8 functional interface part kzbin.info/www/bejne/a2jYeGBnrNWKhpY 3. Java 8 functional interface coding kzbin.info/www/bejne/Z6C0h56wn619mZY 4. Functional Interface prior to Java 8 kzbin.info/www/bejne/a4urd4OfZbSWepI 5. Default methods in interface kzbin.info/www/bejne/eoeklGqFh92Db5Y 6. Default methods Diamond Problem in java 8 kzbin.info/www/bejne/fIK4gYGAaqueorM 7. Java 8 lambda expression kzbin.info/www/bejne/mJzcgHymjKxnjdE 8. Lambda expression variable scope interview questions kzbin.info/www/bejne/lafEhqGLocx_aLc 9. Java 8 predicate functional Interface kzbin.info/www/bejne/nJabkHeGmrGnqNE 10. Java 8 function interface kzbin.info/www/bejne/qJvbeKWQhd-Dm6s 11. Java 8 consumer functional interface kzbin.info/www/bejne/amiaaomJrZd0jrM 12. java 8 supplier functional interface kzbin.info/www/bejne/aZ2bp3-shsqBhrs 13. Java 8 method reference kzbin.info/www/bejne/rouZaIeJaqqNhLc 14. Java 8 optional class kzbin.info/www/bejne/lXaUp3mCjL2jhK8 15. Java 8 stream pipeline flow kzbin.info/www/bejne/an7Vq5KNntWegdk 16. Java 8 stream api operations kzbin.info/www/bejne/ZnfVi2yBrpJ9q5o 17. create java 8 stream kzbin.info/www/bejne/eaW4gKVthKatorM 18. stream api - create java 8 streams kzbin.info/www/bejne/rWqrqItqiJtljK8 19. java 8 stream api- range v/s rangeclosed kzbin.info/www/bejne/laayk4isgpmGrdE 20. java 8 stream api - filter | collect kzbin.info/www/bejne/pJbFp5d9q9qZisk 21. java 8 stream api - map function distinct | filter kzbin.info/www/bejne/e2bCkH2pg7VrZsk 22. java 8 stream api - flatmap kzbin.info/www/bejne/Zn3PaGZtiraqotk 23. java 8 interview question - sort employee list using stream api function kzbin.info/www/bejne/ioa4iIeLpsajjdE 24. java 8 interview question - built in functional interfaces in java kzbin.info/www/bejne/p5PRnWmGodSahpI 25. Create Immutable class in Java kzbin.info/www/bejne/mXvElGyLaa6ap6c 26. what is a web service ? kzbin.info/www/bejne/hYrbYX6ahdyGbpI 27. Watch Introduction to Microservices 08.50 Minutes kzbin.info/www/bejne/r2SVdZ6dorx4Z8U 28. Watch Microservices components in one video 20 Minutes kzbin.info/www/bejne/i4aTfqKOebN5r7s 29. Watch How to Install Spring Tool Suite on Windows Machine kzbin.info/www/bejne/bZrGnmN-eJxgrrM Subscribe and share okayjava kzbin.info
@sreeharikuttuboinaghhthump5824
@sreeharikuttuboinaghhthump5824 2 ай бұрын
Nice explanation
@lakshmidevilakshmidevi3984
@lakshmidevilakshmidevi3984 10 ай бұрын
One of the best playlist for learning java8.Thank you so much.Learnt alot from your videos.keep uploading this kind of videos.
@chethanlvm4833
@chethanlvm4833 Жыл бұрын
Very well exaplained... Best series on Java 8 features
@kirane5911
@kirane5911 Жыл бұрын
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.
@492832
@492832 5 ай бұрын
ppt and way of explanation is good.
@RN-jo8zt
@RN-jo8zt 2 жыл бұрын
i like your teaching style.
@okayjava
@okayjava 2 жыл бұрын
Humbled .. 🙏😊
@mowglishihtzutoy5197
@mowglishihtzutoy5197 3 жыл бұрын
nice explanation ...1 of the best in utube
@okayjava
@okayjava 2 жыл бұрын
Thanks a ton :)
@IamDemotivated
@IamDemotivated Жыл бұрын
Awesome sir... Thank you so much
@vitthal_varak108K
@vitthal_varak108K 2 жыл бұрын
Great teaching
@okayjava
@okayjava 2 жыл бұрын
Thank you :)
@manishc37
@manishc37 3 жыл бұрын
love the way you teach
@okayjava
@okayjava 3 жыл бұрын
thank you
@cooldudev78
@cooldudev78 2 жыл бұрын
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
@okayjava
@okayjava 2 жыл бұрын
thank for your input. appreciated
@thontaradhyapdthonta5538
@thontaradhyapdthonta5538 4 ай бұрын
hi do you have notes hard copy🤩🤩🤩
Java 8 Streams | Optional Usage and Best Practices | JavaTechie
22:22
Angry Sigma Dog 🤣🤣 Aayush #momson #memes #funny #comedy
00:16
ASquare Crew
Рет қаралды 51 МЛН
He bought this so I can drive too🥹😭 #tiktok #elsarca
00:22
Elsa Arca
Рет қаралды 62 МЛН
Teaching a Toddler Household Habits: Diaper Disposal & Potty Training #shorts
00:16
小丑在游泳池做什么#short #angel #clown
00:13
Super Beauty team
Рет қаралды 42 МЛН
Master Optional in Java 8: Complete Guide for Beginners
15:30
Engineering Digest
Рет қаралды 11 М.
Optionals In Java - Simple Tutorial
15:53
Coding with John
Рет қаралды 211 М.
Java Spring Boot 3 Years Interview Experience
33:00
GenZ Career
Рет қаралды 4,7 М.
Cracking the coding interview || Java streams Coding questions
20:31
Java 8 Streams programs you must prepare for Java Interviews
23:02
Angry Sigma Dog 🤣🤣 Aayush #momson #memes #funny #comedy
00:16
ASquare Crew
Рет қаралды 51 МЛН