you are a superb teacher.... I wish I could have come across your channel few years ago... I would be at a different level of java developer. I find all your videos quite engaging, crisp and informative. Keep sharing your knowledge with us.
Complete you tube channels on Java... I will follow only your videos as first reference for specific topic. Which is more clear and understandable.. You are awesome teacher. God bless you Brother. Please add every week one new topic
It's worth to point out that any statement inside ".orElse()" is ALWAYS executed. for example: try calling a function with a print inside ".orElse()". The print statement will be executed regardless of the whether the object is null or not. This might be cause a problem if in the ".orElse()" is an expensive function call (like a database query or a network request). So, it's recommended to use ".orElseGet()" in that case.
@@Javatechie on the contrary. It will be called. but the value will not be returned. try out a function with a executes a print statement then returns a value.
Thanks Man, after going through your map vs flatmap video ,I wanted check this optional video. you have explained in a very simple way. Everything is covered and crystal clear.
Thank you, Only thing is I don't see any difference against checking 200 fields with null check, now this would be checking 200 fields with Optionals/ifPresent etc...
In case of returning methods like orelsethrow,orelseGet inside that why u r giving lambda expression . I have doubt on that can u explain. Please reply
Because they take in functional interfaces as arguments. A one-method instance of a class that implements an interface that only has one abstract method can be created in a few different ways. If we don't plan on using it later, we would use an anonymous class or a lambda expression. In this case, an anonymous class is overkill, because it requires a lot of template syntax for a small simple implementation of a one method interface, so Java added lambda expressions to do the same thing but simpler. Lambda expressions create instances of one-method classes, and don't have a name to refer to. They're lexically scoped. They can only be created in places where the compiler can infer a target type from the context.
1. Here also need to check whether value is present or not using isPresent() then what is the use of this for that if statement is also required. 2.in case or orelse ,i dont want to set some value if is it null then we need to checked by ispresent() ...so how we can say that its resolved our null check problem?
Hi master,very much clear but still we are checking so many conditions for null checks,where actually it's used better than checking the null check in java7
sir which is the best way to protect or secure application.prop file credential in spring boot in Monolithic application .this is new my task how to do please explain sir...
Additionally we were not doing this job , If object not null it will call of() method and inside of() method null check will not happen because it contains value
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.
Great Video, can you make a video on how to encrypt DB password which is declare in a spring properties file (spring boot) like spring.dbpasswrod ="abc" .
Thank you, Only thing is I don't see any difference against checking 200 fields with null check, now this would be checking 200 fields with Optionals/ifPresent etc..@@Javatechie
I know what you mean, but it's understandable. There are other people with worse pronunciation or entonation, but it doesn't mean he can't improve. They have to use Elsa Speak to improve entonation and pronunciation.
you are a superb teacher.... I wish I could have come across your channel few years ago... I would be at a different level of java developer.
I find all your videos quite engaging, crisp and informative.
Keep sharing your knowledge with us.
Thanks Saroj . Keep learning 😊
Directly to the point, no lag, crisp & clear. Keep sharing the content like this 😊👍. Now I know about Optional class. Thanks :-)
showing documentation first is a solid move. solid tutorial. thanks
There are many good teachers. But you are one of the best among them.👏👏👏
Thanks buddy 😊
Thanks!
Very good explanation sir🎉🎉🎉🎉🎉
Complete you tube channels on Java... I will follow only your videos as first reference for specific topic. Which is more clear and understandable.. You are awesome teacher. God bless you Brother. Please add every week one new topic
Thank you so much Gopi 🤗. Glad to hear this
You are the best teacher , thanks sir
Superb tutorial. All concepts of optional cleared. Thanku brdr
Thanks Alone keep learning 😃
Great content. Tricky examples... Thank you so much sir ❤❤
Thanks! Nice & informative!!
Really a informative Videos.
thank you very much for the clear explanation .your videos make the concept clear.
Nyc tutorial....detailed explanation
Thank you for the java course
You are legendary
@21:00 best practice, watch this video completely
Huuuum, amazing! I enjoyed this! Thanks!
Thanks buddy 😊
Many many thnx for the awesome example and explanation.
Keep up the good work 😊
thats best video for the optional class nd u r simply the best
Thanks for posting .. needed content...you explains very well..👍
Keep going nice videos
Your Explanation always superb
Liked 21:00 Best Practice
Nice explanation..!!
Nice explanation
Thanks for such easy and wonderful explanation...!
It's worth to point out that any statement inside ".orElse()" is ALWAYS executed.
for example: try calling a function with a print inside ".orElse()".
The print statement will be executed regardless of the whether the object is null or not.
This might be cause a problem if in the ".orElse()" is an expensive function call (like a database query or a network request).
So, it's recommended to use ".orElseGet()" in that case.
If value is not null then orElse() won't call
@@Javatechie on the contrary. It will be called. but the value will not be returned. try out a function with a executes a print statement then returns a value.
Let me verify this once thanks
orElseGet() is always executed(eager) not orElse()(lazy)
@@Javatechie verified ?
As usual awesome explanation. Great work Bro!
Nice explanation sir ji
Man...
U r just awesome yaaar💥
Thanks buddy ☺️
Great channel! Love your content mate.
Nice explanation broo
You can use Ctrl + d shortcut to copy paste any line.
thanks for smooth explanation brother )
Thank you so much
Commendable job
Thanks Man, after going through your map vs flatmap video ,I wanted check this optional video. you have explained in a very simple way. Everything is covered and crystal clear.
Thank you, Only thing is I don't see any difference against checking 200 fields with null check, now this would be checking 200 fields with Optionals/ifPresent etc...
Thank you!
Wow, upcoming videos on reactive programming!! :-)
Yes complete with test coverage and cloud
@@Javatechie awesome!!
@@Javatechie thanksss!! :D
When can we expect this series? 😀
Please checkout my reactive programming series
great explanation! thanks.
Hi @java Techie, Is java is purely object oriented programming?
awesome
Sir app..java ki full series banaiye..jyse..har koi samaj sake..with practical
Sir.. app java ki. trainning denge kya.. ..we would like to join.
thanks basant for nice content
.please upload video for parallel stream,lazy strems in java8.
Okay I will try that
Java can also be considered as partial object oriented right sir? As it supports primitives too, its not pure object oriented. Correct me if im wrong
Yes
But you can make it purely object oriented by only making use of wrapper classes
Ps: if performance is of no concern
Very clear explanation. Thank you very much! Do you also have react js? Thanks.
No React i started but not much
In case of returning methods like orelsethrow,orelseGet inside that why u r giving lambda expression . I have doubt on that can u explain. Please reply
Because they take in functional interfaces as arguments. A one-method instance of a class that implements an interface that only has one abstract method can be created in a few different ways. If we don't plan on using it later, we would use an anonymous class or a lambda expression. In this case, an anonymous class is overkill, because it requires a lot of template syntax for a small simple implementation of a one method interface, so Java added lambda expressions to do the same thing but simpler.
Lambda expressions create instances of one-method classes, and don't have a name to refer to. They're lexically scoped. They can only be created in places where the compiler can infer a target type from the context.
1. Here also need to check whether value is present or not using isPresent() then what is the use of this for that if statement is also required.
2.in case or orelse ,i dont want to set some value if is it null then we need to checked by ispresent() ...so how we can say that its resolved our null check problem?
Sir please explain java 11 tutorial
Can we create optional of the customer class object ?
Yes we can for list of custom object
Hi master,very much clear but still we are checking so many conditions for null checks,where actually it's used better than checking the null check in java7
yes i am also have same question
sir which is the best way to protect or secure application.prop file credential in spring boot in Monolithic application .this is new my task how to do please explain sir...
Good explanation,please start on reactjs for backend developer
Yes man kunernates and React is my next plan
If we use Optional.of() when we know the object is not null, then what is the purpose of using it?
Buddy we never know where we will get null value so to avoid NPE it's good to have it
Also in ofNullable method if we get null we return empty but if non null we proceed ..still i could see there is a null check inside by Java people
Additionally we were not doing this job ,
If object not null it will call of() method and inside of() method null check will not happen because it contains value
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.
Why can't we use object.getSomething() ! = null instead of using object.isPresent.Then what's the use of optional class??
Great Video, can you make a video on how to encrypt DB password which is declare in a spring properties file (spring boot) like spring.dbpasswrod ="abc" .
You can use spring jasypt
Thank you, Only thing is I don't see any difference against checking 200 fields with null check, now this would be checking 200 fields with Optionals/ifPresent etc..@@Javatechie
Ways to create Optional class
empty
of
ofNullable
Bro do playlist for java8 streams
Yes it is already there please check in playlist section
But it can not handle if empty string is returned
Didn't get you
In that case you need write like this . filter(StringUtils::isNotEmpty). orElse("default")
Please make the ads in the beginning of your videos skippable.
It's not in my hand buddy
How to filter dates using stream
Do you have micro services tutorial
Yes you can refer this
ruclips.net/video/tljuDMmfJz8/видео.html
If you want you can checkout my microservice playlist
I think Java is not PURELY OBJECT ORIENTED LANGUAGE , there are primitive in java
Kotlin video plzZ
It's already there please checkout kotlin playlist
Are you oriya... you sound like one
Content is good but not the accent..
Ignore the accent, focus on getting the knowledge. It's not costing you a single penny, grab the information for free.
@@saurabhsharma7942 ya I tried my best but still....
I know what you mean, but it's understandable. There are other people with worse pronunciation or entonation, but it doesn't mean he can't improve. They have to use Elsa Speak to improve entonation and pronunciation.
oriya boy
Nice explanation