Тёмный

Optionals In Java - Simple Tutorial 

Coding with John
Подписаться 328 тыс.
Просмотров 190 тыс.
50% 1

Full tutorial on Optionals in Java!
Thanks to FlexiSpot for sponsoring! 🖥️ Get your coupon code for an extra $30 OFF through my link: bit.ly/3QPNGko
FlexiSpot Pro Plus Standing Desk E7
bit.ly/3xTvGNF (US site)
bit.ly/3OEL9aT (CAN site)
Join FlexiSpot Member Day during 29-30th June 2022! Up to $100 OFF! bit.ly/3u0akNa
#MyFlexiDesk #flexiblewfh
Complete Java course: codingwithjohn.thinkific.com/...
Optionals were added in Java 8, but can be a confusing thing to learn. This tutorial will walk through all of the aspects of Optionals in Java detail, then walk through step by step when and how to use optionals in your own code!
If you're confused by Optionals in Java, either just what they are and why they exist in general, or how to code to use them in Java, you're in the right place!
Learn or improve your Java by watching it being coded live!
Hi, I'm John! I'm a Lead Java Software Engineer and I've been in the programming industry for more than a decade. I love sharing what I've learned over the years in a way that's understandable for all levels of Java learners.
Let me know what else you'd like to see!
Links to any stuff in this description are affiliate links, so if you buy a product through those links I may earn a small commission.
📕 THE best book to learn Java, Effective Java by Joshua Bloch
amzn.to/36AfdUu
📕 One of my favorite programming books, Clean Code by Robert Martin
amzn.to/3GTPVhf
🎧 Or get the audio version of Clean Code for FREE here with an Audible free trial
www.audibletrial.com/johnclean...
🖥️Standing desk brand I use for recording (get a code for $30 off through this link!)
bit.ly/3QPNGko
📹Phone I use for recording:
amzn.to/3HepYJu
🎙️Microphone I use (classy, I know):
amzn.to/3AYGdbz
Donate with PayPal (Thank you so much!)
www.paypal.com/donate/?hosted...
☕Complete Java course:
codingwithjohn.thinkific.com/...
codingwithjohn.com

Опубликовано:

 

26 июн 2022

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 428   
@stevenschelling8452
@stevenschelling8452 Год назад
This is the gold standard of coding tutorials, thanks for such well-structured info
@iamarnabpal
@iamarnabpal Год назад
Seriously... Pure GOLD!
@YatiAcharya
@YatiAcharya 10 месяцев назад
You know how I am certain this is the best Java channel? I have no interviews to crack, I have no exams to clear and I'm still here learning because it just is explained in such an interesting, problem-solution kinda way. Brilliant work, John!
@Amitjha406
@Amitjha406 6 месяцев назад
Agreed
@BryanChance
@BryanChance 5 месяцев назад
Yes, I second that. This is the best Java channel. :)
@nikamz6077
@nikamz6077 Год назад
My coding exam is in just about a month - and I would like to thank you, John! You have helped me so much. If I pass, thats because of you. Love your channel! Greetings from germany. :)
@nikamz6077
@nikamz6077 Год назад
Update: I passed. 😍💪🏻
@celeryman1650
@celeryman1650 Год назад
Congrats!!
@CodingWithJohn
@CodingWithJohn Год назад
Great to hear! Congrats!
@user-nu6vz9pt8g
@user-nu6vz9pt8g 9 месяцев назад
@@nikamz6077 Congrats!
@ItIsJan
@ItIsJan 9 месяцев назад
​@@nikamz6077gut gemacht!
@juanantoniosicardocontrera8390
@juanantoniosicardocontrera8390 3 месяца назад
It's very difficult to find such well explained, well paced and easy to understand coding tutorials on youtube, thanks and congrats for having such good content.
@adrianfiedler3520
@adrianfiedler3520 Год назад
Always wondered what the true benefit of optionals vs null checks is. This really cleared things up for me!
@gulbalasalamov1367
@gulbalasalamov1367 Год назад
Love the cat example and box metaphor! :) 4:45
@LightningLion500
@LightningLion500 Год назад
I just started watching your channel and I love your calm and reassuring way of explaining complex coding aspects! It motivated me to work a little harder on my own projects, unlike the often condescending explainations of the teachers at my university. Thanks John!
@cloyyd2227
@cloyyd2227 Год назад
i just started my internship for the summer and the code they have us working with has a ton of optionals, which was something i had never heard of. You’re videos are truly always a highlight to my day and explain it so neatly and concisely, not to mention the timing! please keep doing what you do
@MariaBose-ky9jf
@MariaBose-ky9jf Год назад
I love your channel for the calm and precise manner you describe things with - and also the nerdy references ahah
@gerdsfargen6687
@gerdsfargen6687 Год назад
So good..guys, just keep coming back to John's channel. He explains everything with the greatest of ease.
@RsZ789
@RsZ789 Год назад
Great job, John. Can you please cover logging and best practices for it?
@chinmayrath8494
@chinmayrath8494 Год назад
please keep blessing us with such non trivial concepts. much love !!
@sg4644
@sg4644 8 месяцев назад
I've a exam on Java tomorrow and I've to say your videos on Java are probably the best on RU-vid. Will be binge watching the your entire Java playlist tonight.
@christianolsson8644
@christianolsson8644 Год назад
What an excellent video! I have studied Java but not worked with it and now I try to polish my knowledge to get a job in Java. I want to thank you for your easy to understand and amazing videos that take up very important and interesting topics. You're an amazing teacher and you get excited to learn more to look at your videos :)
@midhunmadhu5305
@midhunmadhu5305 Год назад
I don't usually comment on any youtube videos. But here John, You are doing an excellent job describing topics in a simpler manner. Thank You.
@rlasc84
@rlasc84 Год назад
Nice solution for dealing with null exceptions. So much cleaner than use ifs to check the return value. Hopefully some day java implements de null safe operator like groovy or kotlin. Great video John!
@user-jz4iz2qh9u
@user-jz4iz2qh9u Год назад
Your channel is my go to for any Java related topic. Thank you! Could you please consider making some design patterns tutorials? 🙏🏻
@zaph8015
@zaph8015 Год назад
Null safety is one of the reasons I fell in love with Kotlin. It's caught me out so many times and helped me to think about where NPEs might be found even when working in other languages.
@petarJK
@petarJK Год назад
Excellent video! Very well explained. It's one thing to know something, totally different thing to be able to explain it well. Thanks!
@mohammedalbj4268
@mohammedalbj4268 10 месяцев назад
This is pure gold, thank you so much!
@MrLuMax5
@MrLuMax5 Год назад
Have been waiting for this for a long time, thank you!
@dinaadel1672
@dinaadel1672 Год назад
your videos are really useful and easy to understand.. and you are explaining lots of interview subjects.
@juvipana
@juvipana Год назад
This was awesome, you made me chuckle. Made it really easy to follow, thank you!
@miltonezeh5085
@miltonezeh5085 7 месяцев назад
You are the BEST on these streets.
@Fnaf-vh9cs
@Fnaf-vh9cs Год назад
this is something new definitely, IL look tomorrow into video and check some exercises. thanks John
@rikkarth_
@rikkarth_ 11 месяцев назад
Thank you, this video has helped me immensely.
@viswanathsairam5956
@viswanathsairam5956 Год назад
Optionals demystified with your video. Thanks a lot for this precise explanation
@j.franciscox3318
@j.franciscox3318 9 месяцев назад
Love that desk setup, could you do a video about your desk setup? And maybe other stuff as well, such as your favorite IDE, text editors etc.
@Anderzon1994
@Anderzon1994 Год назад
Thanks for sharing your knowledge! I enjoy watching your tutorials!
@sanjayranga2683
@sanjayranga2683 Год назад
The best possible explanation of Optional . You ve earned a subs and keep up.
@user-te9hf7qs1y
@user-te9hf7qs1y Год назад
Thank you for your excellent videos! Best explanation of these small java- things!
@ShermukhammadKarimov
@ShermukhammadKarimov 5 дней назад
thanks for the clear explanation
@ramkumar_balu
@ramkumar_balu Год назад
Perfect and standard video about the Optional.
@Ke5gggggel
@Ke5gggggel Год назад
Love your videos! Always looking if you made a video on the java subject I am looking for first before I watch a video of somebody else. Do a Tutorial about Streams please!
@emilywilson7835
@emilywilson7835 6 месяцев назад
This channel brings me so much joy, and taught me so much. Thanks!
@ahouzimohamed6387
@ahouzimohamed6387 Год назад
Hi John thank u for ur efforts , can u please do a tutoriel about the spring and spring boot it will be amazing by u
@Un_Fulano_
@Un_Fulano_ Год назад
It would have taken me hours to look for and understand this information by myself. Thanks John.
@isleschild
@isleschild 24 дня назад
thanks for the work, this was excellent.
@ReBufff
@ReBufff Год назад
Didn't even know what optionals were until now. Thanks!
@gabrielfono844
@gabrielfono844 11 месяцев назад
this is so amazing as backend engineer, I 100% agree thanks a lot
@magadiflo-dev
@magadiflo-dev Год назад
Excellent explanation, calmly, deliberately and well mastered the subject, thanks for sharing your knowledge, greetings from Peru 🇵🇪
@JoaoLima-pq1hm
@JoaoLima-pq1hm 8 месяцев назад
Precious content, thank you! Greetings from Brazil 😊
@chentang514
@chentang514 Год назад
Amazing tutorial. Very clear.
@TechOnScreen
@TechOnScreen Год назад
you just compiled all the facts about optional, thanks. can you also make a video on streams and lambdas and collections using them together to build business grade logical error-proof solutions..
@xtay2287
@xtay2287 Год назад
Didn't know about the map-method. Thanks :)
@liliabekuzinaensosense8987
@liliabekuzinaensosense8987 Год назад
You are just AMAZING! Please never stop! 💫
@pranaylonkar19
@pranaylonkar19 Год назад
Awesome video...👍 Now this concept is crystal clear. Please upload videos on streams, functional interface, method reference, and default method. Thanks...
@Ramison273
@Ramison273 Год назад
my god, you are the best. i am from brazil and i am learning a lot with you. i love java and i found your channel last month, i am watching all your videos, your english and your explanation is so easy to understand.. thank you 😁😁
@vamonosraza4361
@vamonosraza4361 Год назад
I am So grateful for your videos!
@LutfarRahmanMilu
@LutfarRahmanMilu 10 месяцев назад
Absolutely brilliant teaching style.
@mohammadsadeghsheikhzahedi3682
@mohammadsadeghsheikhzahedi3682 9 месяцев назад
Great job 🙏
@gamingislove3030
@gamingislove3030 Год назад
Best video i ever saw on Optional.🎉🎉
@BrunoAraujo14
@BrunoAraujo14 2 месяца назад
Thanks for this class, Schrodinger! 4:35
@iot_enthusiast
@iot_enthusiast Год назад
Wondering if you are planning to create Spring Boot content anytime soon :) After watching several videos in your channel, I believe that with that highly intuitive style of explaining subtle as well as complex, hard to understand concepts, the new content will attract a lot of views. Happy to be a subscriber :)
@xmaxxxwellx
@xmaxxxwellx Год назад
Hi John! It's fantastic) I'm really appreciate it. The video is great! Thanks a lot :)
@rezahajivand7498
@rezahajivand7498 9 месяцев назад
Hello mr jhon . Thanks for your teaching video 🎉🎉🎉
@boldschool6308
@boldschool6308 Год назад
I definitely learned something! Thanks
@ginasomara267
@ginasomara267 Год назад
Bro life saver. Your videos are amazing.
@yashaswipandey7923
@yashaswipandey7923 Год назад
Thanks man, i needed that.
@asherkhan2656
@asherkhan2656 10 месяцев назад
Great explanation John
@Softrough1989
@Softrough1989 Год назад
Very good explanation and I loved the cat and the box. Thanks
@SUMITYADAV-cy9hf
@SUMITYADAV-cy9hf 2 месяца назад
hey John !!! amazing work requesting you to create a spring framework course as well .
@gopalkannan4934
@gopalkannan4934 Год назад
I love your channel. Thank you so much
@mohamedlegtibi802
@mohamedlegtibi802 Год назад
Best teacher so far. Greetings from Morocco 🇲🇦
@azam11250
@azam11250 2 месяца назад
great explaination sir. really liked ur videos and learned a lot. Thanks sir
@eduardoprado8055
@eduardoprado8055 Год назад
Awesome explanation!
@shakilahmed4647
@shakilahmed4647 Год назад
Before this I used to think optional is a mysterious box in Java. Thanks for the video
@reynerb3918
@reynerb3918 2 месяца назад
Thank you for the video, this is great content...
@cosmoatlas2435
@cosmoatlas2435 Год назад
wish I had you the sophomore year of college. Great work!
@jaylawlmc1915
@jaylawlmc1915 Год назад
THANK YOU SO MUCH for actually explaining when are where optionals are actually useful as opposed to using a return annotated with "@Nullable". I am lucky to have understood this topic before watching your video, but before i got to that point i was *severely struggling* to get behind why i would use Optional instead of null in the first place. That is due to many tutorials on optionals just leaving things at "it's a container where a value may or may not be present" but not going as far as you did. I'm absolutely certain this video of yours will help tons of people!
@pauldhartley
@pauldhartley Год назад
I must confess to still being confused at the usefulness of optionals, though the video explains admirably some of the characteristics.
@jaylawlmc1915
@jaylawlmc1915 Год назад
@@pauldhartley cleaner and more functional code. Try working with streams for example. You cannot unlock the full power of streams using null checks
@jaylawlmc1915
@jaylawlmc1915 Год назад
@@pauldhartley I point out functionality because you cannot much with a null value, other than check it and pass it. Optionals on the other hand, are integrated into javas core functionality. You can do tons of things with them just with what java provides. That doesn't even take into account what you or others may code for it
@muhammedemad1155
@muhammedemad1155 Год назад
Great tutorial , thank you
@jagger6277
@jagger6277 Год назад
THANK YOU!!!
@whitneybrown1715
@whitneybrown1715 Год назад
Awesome tutorial!
@timmelis4872
@timmelis4872 Год назад
Another very well explained video ...
@shepherdej1010
@shepherdej1010 Год назад
Hey John, first off, fantastic Video and well explained. Second, would you be able to do a video on the Java Garbage Collector and ways to utilize it?
@ultimatehuzefa
@ultimatehuzefa Год назад
Best Java Tutor!!
@arcane3327
@arcane3327 Год назад
The explanation with your cat was really great. Thanks for the good tutorial!
@siegfriedkurz8753
@siegfriedkurz8753 Год назад
Impressively explained.
@saiprakash5501
@saiprakash5501 Год назад
Hi John, Nice content!...Keep up the good work🤝
@RotatingBuffalo
@RotatingBuffalo Год назад
This is an example of a monad, in case anyone here has heard of monads but doesn't know what they are useful for yet. They generally provide a "Wrapper type" that you can use to chain operations safely on, without having to do intermediate work between every function/method.
@d2k2
@d2k2 4 месяца назад
Thank you!
@nishiths9228
@nishiths9228 Год назад
I always check out your videos cause it’s very easy to understand even the difficult concepts because of easy to understand explanations. I would love to buy the keyboard that you are using , which one is that :) Thanks in advance .
@dsmohammadaslam9527
@dsmohammadaslam9527 3 месяца назад
your are just extraordinary sir , thank you sir please make video on java date and time
@victor__425
@victor__425 Год назад
Awesome! The society demands explaining all java features basing on this cute cat
@tostanco1117
@tostanco1117 Год назад
I do recognize the way you speak so clearly.
@dhilip77
@dhilip77 Год назад
Your explanation are really simple, when could I expect spring boot
@sebon11
@sebon11 Год назад
Great video as always
@alinesinclaire2854
@alinesinclaire2854 11 месяцев назад
epic explanation with the cat in the box it was so funny!
@svalyavasvalyava9867
@svalyavasvalyava9867 Год назад
thank you infinitely!!!
@VivekSharma-zb6no
@VivekSharma-zb6no Год назад
Nice explanation 😊
@philbowden3894
@philbowden3894 Год назад
Once again....excellent video.
@aurojitbasak3249
@aurojitbasak3249 Год назад
Great 👍👍👍 I was waiting for your video. Thanks. Love from India. ❤️❤️
@xugefu
@xugefu Год назад
Thanks!
@nate6199
@nate6199 Год назад
Would you be able to do a video on using serializable for persistent data?
@vijaydhanakodi5591
@vijaydhanakodi5591 Год назад
you should really teach design patterns. one of the best tutor in the universe.
@ashadahmad651
@ashadahmad651 Год назад
I loved your explanation John, the way you explained was amazing, soothing and very clear. Especially loved the part where you mentioned how exactly a Optional is intended to be used, amazing content. Any chance you make courses on Springboot, Microservices etc please do upload them if you do or provide us a link to the course. Thanks once again.
@Manish-ly7iw
@Manish-ly7iw Год назад
his name is john though
@ashadahmad651
@ashadahmad651 Год назад
@@Manish-ly7iw ohhh shit
@Anon-jz7iw
@Anon-jz7iw 2 месяца назад
holy crap i was getting everything but the end just screwed with my head more, would definitely try to apply this in my project to learn it more
@akshaysilgari2097
@akshaysilgari2097 Год назад
Very nice explain bro.....
@kareem7236
@kareem7236 Год назад
thank you soo much
@mdk1983
@mdk1983 3 месяца назад
A 6'5'' John saying "OR ELSE" to the face is quite a threat 😀 Wonderful and interesting tutorial as always. You're the best John!
Далее
Lambda Expressions in Java - Full Simple Tutorial
13:05
How To Call a REST API In Java - Simple Tutorial
29:14
Просмотров 246 тыс.
Set and HashSet in Java - Full Tutorial
20:43
Просмотров 183 тыс.
Generics In Java - Full Simple Tutorial
17:34
Просмотров 998 тыс.
Java. Для чего нужен Optional?
18:26
Просмотров 11 тыс.
Java 8 STREAMS Tutorial
18:10
Просмотров 723 тыс.