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
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?
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()
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
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.
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.
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
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!
Brother , you are a good teacher.
I have never seen anyone so clear in teaching. You are born talented.
Thanks buddy
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
amazing explanation, you should create some playlist related to Collections, data structures and best practices. Thanks bro
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?
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 ...!!!
That's some great quality content! Thanks for sharing it bro, have a good day
You too Eduardo. Thanks
clear, concise and very well explained ! a deep thanks to Amigoscode :)
Gratidão, Mr. James, Show D+!!!!
Amazing explanation!! Thank you Nelson.
Simple and obvious explanation ...
Thanks for doing this. I continue to learn from you on a regular basis!!
Very well explained. Thank you for clarifying why it's beneficial to use. I feel like a lot of videos jump right over that.
Thank you, great tutorial! Consice and well explained! 💛
Well done brother
thanks brother
Gracias hermano
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
better than many paid courses
Lol thanks
Your explanation is pretty clear. Thanks!
I watched video about same topic from Coding with John channel and I must say that he have the better desk.
love the new info... I actually had a ton of repetitive code that could've been solved with this
This was great help, man. Thanks a bunch.
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.
Nice tutorial, helped a ton!
thanks buddy
Goood explanation!! Awesome!
Thank you. Great explanation 😊
Cool explanation. Thank you😊
Thank you Nelson for your valuable tutorial. I wish I knew you when I first started the java course.
Thanks! Great work!
Thank you very much. Very clear explanation.
Thanks for the tutorial mate.. Cheers
Fantastic tutorial good friend, keep it up.
Great explenation. very clear!
thanks!
Thanks a lot! 😊 🙌
Very helpful! Thanks so much!
You welcome my friend
Good as allways.
Thanks
Thank you for the video. Very usefull.
Thanks very much, nice explanation!
Great job, man! Thank you!)
Thanks
Super useful, thanks!
Great tutorial, thanks!
Thanks man
简单明了,help me a lot.Thank you,谢谢
You are welcome Du
Thank you, your video helped me a lot!!! :)
Very useful, thank you very much!
you welcome
I prefer using a enum and clause orElse inside de public Optional getEmail()
Why did you prefer using on sout
thanks for explaining it well.
Great video! Can we integrate the optional with Stream?
Yes of course check amigoscode.com
Great Tutorial. Thank You :)
Great stuff!
great quality
Thanks brother......
Nice! Thank you very much!
You welcome
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.
Did you use lambda expressions here, if so, does Optional use lambda by default?
thank you
Thanks for excellent video!
Thanks
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
Thank you.
Excelent...
Thank you so much
Thanks a lot amigo!!!
You welcome Joseph
Hello, is it a good practice to pass options as a parameter?
thanks
You welcome
Please make a series on reactive java if you have knowledge about it
Super!
I love this!!!
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?
I cannot get, how we tackle this with POJO, as we dealing with JSON and Jackson ?
شكرا لك
hello , so whats the use of optional.of() if it does not able to handle null.
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..?
Nice tut. Suggestion, plz zoom when typing. I had to squint while watching
Same
How do you write a null and empty check for a string using optional ?
That was very helpful thank you daddy😁❤
you welcome cinhoooooo :)
what can Isay? best free tutorial for Optionals
How do I use sout on Eclipse?
what about OptionalInt ? can we sort a set of OptionalInt ?
thank you
👍
For
Optional obj = Optional.of("Hello");
i am getting
Type mismatch: cannot convert from Optional to Optional
@@subhrajeetmitra3681 A String is not an Object.
TYY
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.
Where is my comment was it deleted?
legend!
todo: redo all my projects using this
badhiya sikhata hai re tu kallumal :)
i appreciate you babe
Assalamualaikum brother
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.
порядочно пояснил
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