Hi Amigoscode, I've just got to know your channel these days and this is a really great channel for me to follow, to be honest. Thank you so much for your time and effort to make your videos. By the way, during the time watching your videos, I found you used some amazing shortcuts frequently which help to save a lot of coding time. Could your please let me know those shortcuts for: 1. Changing a specific code to method reference, as at 10:07 2. Extracting a variable to hold the value of specific code. For example: List vehicles = abc.getVehicles(); 3. Replacing all of a specific text by another at once, as at 3:32 Many thanks
@@amigoscode thank you so much for your response. By the way, I just want to let you know that I am going to take your Spring+React course and I hope it would be going well. :D
Very clearly explained, good examples, thank you. Worth noting that the tutorial is for Java 11. Optionals were introduced in Java 8 but with fewer features e.g. no isEmpty()
I think this is clear ... and thank you. But I have to observe that as I write a lot of methods that return null as a fallback, explicit null checks are easy and often absolutely necessary depending upon what you need a program to do.
It seems oracle dudes love to make code look more difficult or instead of making code leas they love to make it too much. I say about dev of oracle. No doubts android leaving java . With all respect im a /learning java too. Why oracle wants code look verbose?
Thank you so much for your tutorials and explanations, im starting with java and this classes helps me really much. Awsome teacher. You have won a suscriber
Great presentation.. Isn’t it costly to use optional with instance variables, each time we create an instance a new instance also requires for optional right
Good explanation but, what if I want to return "Person"? How will that work with nullable? So say I make a get request and in the DB, no "Person" might exist
great tutorial indeed, but im having a hard time finding the holy grail of a tutorial that lets it click inside of me as to why optionals are *that* much better than null checks. i just don't get it :|
I feel optional is mainly useful when we are dealing with chain of operations. Like chaining filter, map,flat-map operations on an optional object. Even if output of one stage is an empty object, it won't throw a runtime exception at next stage when we are calling a function on the empty object. So we do not need to check for exception at every stage. At the end we could use ifpresent method. this is the only scenario where i found this to be a bit useful compared to null check.
ArrayList list=new ArrayList(); list.add("Mango"); list.add("Apple"); list.add("Banana"); list.add("Grapes"); Optional list1=Optional.ofNullable(list); list1.filter((item)->{ System.out.println(item); return true;}) or ist1.map((item)->{ System.out.println(item); return item;}) is there any way with filter and map of optional to iterate one by one on array element when i using this it returning me the whole array.
NelsonI like your tutorials man, but this one was messy. You didnt get to the basic fact that Optionals have a main purpose of telling the user that a value being returned might be null and he has to deal with it.
Even for not native english speackers, your classes are very useful. You are a fantastic teacher. Health, love, peace and success!
I have never seen anyone so clear in teaching. You are born talented.
Thanks buddy
Brother , you are a good teacher.
Dude i learned more from u in 15 min than a whole semester for my professor. Thx man keep up with the good work.
You are welcome 🙏
Great tutorial!!!
I'm not an English native speaker, still I got all information i needed))
Thank you!
Thank you Nazarri
Best Java tutorials I’ve seen are on your channel 🙌🏽
Hi Amigoscode,
I've just got to know your channel these days and this is a really great channel for me to follow, to be honest. Thank you so much for your time and effort to make your videos.
By the way, during the time watching your videos, I found you used some amazing shortcuts frequently which help to save a lot of coding time. Could your please let me know those shortcuts for:
1. Changing a specific code to method reference, as at 10:07
2. Extracting a variable to hold the value of specific code. For example: List vehicles = abc.getVehicles();
3. Replacing all of a specific text by another at once, as at 3:32
Many thanks
Hi 👋 . Thanks for your comment. Means a lot. So in this course I cover all shortcuts. th-cam.com/video/yefmcX57Eyg/w-d-xo.html&t
Also you can see the keyboard shortcuts in the video.
@@amigoscode thank you so much for your response. By the way, I just want to let you know that I am going to take your Spring+React course and I hope it would be going well. :D
Very clearly explained, good examples, thank you. Worth noting that the tutorial is for Java 11. Optionals were introduced in Java 8 but with fewer features e.g. no isEmpty()
Yup absolutely right
Also ifPresentOrElse(); is not is java 8, The LTS version of java widely used ...!!!
amazing explanation, you should create some playlist related to Collections, data structures and best practices. Thanks bro
clear, concise and very well explained ! a deep thanks to Amigoscode :)
I watched video about same topic from Coding with John channel and I must say that he have the better desk.
I think this is clear ... and thank you. But I have to observe that as I write a lot of methods that return null as a fallback, explicit null checks are easy and often absolutely necessary depending upon what you need a program to do.
Very well explained. Thank you for clarifying why it's beneficial to use. I feel like a lot of videos jump right over that.
That's some great quality content! Thanks for sharing it bro, have a good day
You too Eduardo. Thanks
At 14:25 on line 17 when you are doing the ifPresent check, what is the difference between that and the null check at 0:20, which was a code smell?
It seems oracle dudes love to make code look more difficult or instead of making code leas they love to make it too much. I say about dev of oracle. No doubts android leaving java . With all respect im a /learning java too. Why oracle wants code look verbose?
I prefer using a enum and clause orElse inside de public Optional getEmail()
Why did you prefer using on sout
Simple and obvious explanation ...
Amazing explanation!! Thank you Nelson.
Gratidão, Mr. James, Show D+!!!!
better than many paid courses
Lol thanks
Thanks for doing this. I continue to learn from you on a regular basis!!
Thank you, great tutorial! Consice and well explained! 💛
Your explanation is pretty clear. Thanks!
Thank you so much for your tutorials and explanations, im starting with java and this classes helps me really much. Awsome teacher. You have won a suscriber
Well done brother
thanks brother
Thank you very much. Very clear explanation.
love the new info... I actually had a ton of repetitive code that could've been solved with this
How do you write a null and empty check for a string using optional ?
Thanks for the tutorial mate.. Cheers
Goood explanation!! Awesome!
Cool explanation. Thank you😊
For
Optional obj = Optional.of("Hello");
i am getting
Type mismatch: cannot convert from Optional to Optional
Thank you Nelson for your valuable tutorial. I wish I knew you when I first started the java course.
Gracias hermano
hello , so whats the use of optional.of() if it does not able to handle null.
Did you use lambda expressions here, if so, does Optional use lambda by default?
I cannot get, how we tackle this with POJO, as we dealing with JSON and Jackson ?
Fantastic tutorial good friend, keep it up.
Good as allways.
Thanks
Thank you. Great explanation 😊
This was great help, man. Thanks a bunch.
Thanks! Great work!
Nice tutorial, helped a ton!
thanks buddy
Thank you for the video. Very usefull.
Hello, is it a good practice to pass options as a parameter?
Great presentation.. Isn’t it costly to use optional with instance variables, each time we create an instance a new instance also requires for optional right
Please make a series on reactive java if you have knowledge about it
Great explenation. very clear!
thanks!
Thanks very much, nice explanation!
简单明了,help me a lot.Thank you,谢谢
You are welcome Du
Very helpful! Thanks so much!
You welcome my friend
great quality
Good explanation but, what if I want to return "Person"? How will that work with nullable?
So say I make a get request and in the DB, no "Person" might exist
Optional obj = Optional.ofNullable(db.getPerson());
Something like that..?
great tutorial indeed, but im having a hard time finding the holy grail of a tutorial that lets it click inside of me as to why optionals are *that* much better than null checks. i just don't get it :|
I feel optional is mainly useful when we are dealing with chain of operations. Like chaining filter, map,flat-map operations on an optional object. Even if output of one stage is an empty object, it won't throw a runtime exception at next stage when we are calling a function on the empty object. So we do not need to check for exception at every stage. At the end we could use ifpresent method. this is the only scenario where i found this to be a bit useful compared to null check.
It was added (along with a lot of other stuff) to support functional programming.
what can Isay? best free tutorial for Optionals
Thanks a lot! 😊 🙌
Great video! Can we integrate the optional with Stream?
Yes of course check amigoscode.com
ArrayList list=new ArrayList();
list.add("Mango");
list.add("Apple");
list.add("Banana");
list.add("Grapes");
Optional list1=Optional.ofNullable(list);
list1.filter((item)->{ System.out.println(item); return true;}) or ist1.map((item)->{ System.out.println(item); return item;})
is there any way with filter and map of optional to iterate one by one on array element when i using this it returning me the whole array.
Very useful, thank you very much!
you welcome
Great job, man! Thank you!)
Thanks
How do I use sout on Eclipse?
Great tutorial, thanks!
Thanks man
thanks for explaining it well.
Excelent...
Great stuff!
Super useful, thanks!
So does this mean that imperative programming is becoming null?
No and never but sometimes there things that can be improved using functional programming
Amigoscode oh okay that’s good to know. Are there any projects you’d recommend doing to practice streams/functional programming?
thank you
Super!
todo: redo all my projects using this
Nice tut. Suggestion, plz zoom when typing. I had to squint while watching
Same
Thank you, your video helped me a lot!!! :)
Nice! Thank you very much!
You welcome
I love this!!!
Sir, will u plz make a complete video on lambda expressions.
Waheed Khan there is one already
@@amigoscode thanks Sir.
Also make a tutorial on microservices. I got the job because of your tutorials.
Thanks for excellent video!
Thanks
what about OptionalInt ? can we sort a set of OptionalInt ?
thank you
Thanks brother......
Thanks a lot amigo!!!
You welcome Joseph
Great Tutorial. Thank You :)
Thank you.
Thank you so much
شكرا لك
legend!
thanks
You welcome
That was very helpful thank you daddy😁❤
you welcome cinhoooooo :)
TYY
Where is my comment was it deleted?
Assalamualaikum brother
👍
badhiya sikhata hai re tu kallumal :)
i appreciate you babe
порядочно пояснил
I guess thanks
NelsonI like your tutorials man, but this one was messy. You didnt get to the basic fact that Optionals have a main purpose of telling the user that a value being returned might be null and he has to deal with it.
Thank you for tutorial, but I don't like ASMR
Great tutorial! Thank you!
Great tutorial! Thanks!!!
Thanks for the great tutorial!
Thank you