Java 8 Streams | Optional Usage and Best Practices | JavaTechie

Поделиться
HTML-код
  • Опубликовано: 25 дек 2024

Комментарии • 113

  • @kumarsaroj18
    @kumarsaroj18 2 года назад +16

    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.

    • @Javatechie
      @Javatechie  2 года назад +2

      Thanks Saroj . Keep learning 😊

  • @meevizagabbai
    @meevizagabbai Год назад +4

    Directly to the point, no lag, crisp & clear. Keep sharing the content like this 😊👍. Now I know about Optional class. Thanks :⁠-⁠)

  • @abhilashpatel6852
    @abhilashpatel6852 Год назад +2

    showing documentation first is a solid move. solid tutorial. thanks

  • @LwP79
    @LwP79 2 года назад +7

    There are many good teachers. But you are one of the best among them.👏👏👏

  • @manisshkhaparde7619
    @manisshkhaparde7619 2 года назад +1

    Thanks!

  • @kirane5911
    @kirane5911 Год назад +1

    Very good explanation sir🎉🎉🎉🎉🎉

  • @gopisambasivarao5282
    @gopisambasivarao5282 Год назад +1

    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

    • @Javatechie
      @Javatechie  Год назад

      Thank you so much Gopi 🤗. Glad to hear this

  • @SarvaKrishna-s2g
    @SarvaKrishna-s2g 10 месяцев назад

    You are the best teacher , thanks sir

  • @alone_man3198
    @alone_man3198 Год назад +1

    Superb tutorial. All concepts of optional cleared. Thanku brdr

    • @Javatechie
      @Javatechie  Год назад

      Thanks Alone keep learning 😃

  • @supun_sandaruwan
    @supun_sandaruwan 11 месяцев назад +1

    Great content. Tricky examples... Thank you so much sir ❤❤

  • @abhisheksaraf6434
    @abhisheksaraf6434 Месяц назад +1

    Thanks! Nice & informative!!

  • @kiransomase2493
    @kiransomase2493 2 года назад +1

    Really a informative Videos.

  • @sowjanyapeddiraju6532
    @sowjanyapeddiraju6532 2 года назад +1

    thank you very much for the clear explanation .your videos make the concept clear.

  • @peterg.1075
    @peterg.1075 3 года назад +1

    Nyc tutorial....detailed explanation

  • @seyhaseng1077
    @seyhaseng1077 2 года назад +1

    Thank you for the java course
    You are legendary

  • @overview1662
    @overview1662 2 года назад +1

    @21:00 best practice, watch this video completely

  • @francksgenlecroyant
    @francksgenlecroyant 3 года назад +1

    Huuuum, amazing! I enjoyed this! Thanks!

  • @manisshkhaparde7619
    @manisshkhaparde7619 2 года назад

    Many many thnx for the awesome example and explanation.

  • @kishordige9721
    @kishordige9721 2 года назад +1

    Keep up the good work 😊

  • @adkk1996
    @adkk1996 3 года назад +1

    thats best video for the optional class nd u r simply the best

  • @ramvillagetraveller5312
    @ramvillagetraveller5312 3 года назад +2

    Thanks for posting .. needed content...you explains very well..👍

  • @jptechnoservice9013
    @jptechnoservice9013 3 года назад +2

    Keep going nice videos

  • @dmuniraja361
    @dmuniraja361 3 года назад +1

    Your Explanation always superb

  • @prisinha
    @prisinha 3 года назад +1

    Liked 21:00 Best Practice

  • @Sushil2874
    @Sushil2874 3 года назад +1

    Nice explanation..!!

  • @vaibhavsrivastava4645
    @vaibhavsrivastava4645 3 года назад +1

    Nice explanation

  • @amolghule4223
    @amolghule4223 3 года назад +1

    Thanks for such easy and wonderful explanation...!

  • @Vogel42
    @Vogel42 3 года назад +2

    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
      @Javatechie  3 года назад

      If value is not null then orElse() won't call

    • @Vogel42
      @Vogel42 3 года назад +1

      @@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.

    • @Javatechie
      @Javatechie  3 года назад

      Let me verify this once thanks

    • @sreesri8492
      @sreesri8492 3 года назад +3

      orElseGet() is always executed(eager) not orElse()(lazy)

    • @ahishnar1568
      @ahishnar1568 3 года назад

      @@Javatechie verified ?

  • @nirmesh44
    @nirmesh44 3 года назад +2

    As usual awesome explanation. Great work Bro!

  • @pratishrutipanda6461
    @pratishrutipanda6461 3 года назад +1

    Nice explanation sir ji

  • @bnitheesh9186
    @bnitheesh9186 3 года назад +1

    Man...
    U r just awesome yaaar💥

  • @blaugranisto
    @blaugranisto 3 года назад +1

    Great channel! Love your content mate.

  • @sandhyamachani8720
    @sandhyamachani8720 3 года назад +1

    Nice explanation broo

  • @vikasbaghel2647
    @vikasbaghel2647 2 года назад +1

    You can use Ctrl + d shortcut to copy paste any line.

  • @revan_hajiyev
    @revan_hajiyev 10 месяцев назад

    thanks for smooth explanation brother )

  • @deeptoadhikary689
    @deeptoadhikary689 Год назад +1

    Thank you so much

  • @ANKITCHOUDHARYankitkrchy
    @ANKITCHOUDHARYankitkrchy 2 года назад

    Commendable job

  • @akshayverma6216
    @akshayverma6216 3 года назад +2

    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.

  • @diegoramos27
    @diegoramos27 2 года назад

    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...

  • @kishordige4654
    @kishordige4654 2 года назад +1

    Thank you!

  • @saravanprathi6956
    @saravanprathi6956 3 года назад +3

    Wow, upcoming videos on reactive programming!! :-)

    • @Javatechie
      @Javatechie  3 года назад +8

      Yes complete with test coverage and cloud

    • @saravanprathi6956
      @saravanprathi6956 3 года назад +1

      @@Javatechie awesome!!

    • @ThePomelo09
      @ThePomelo09 3 года назад +1

      @@Javatechie thanksss!! :D

    • @sreddy8141
      @sreddy8141 3 года назад +1

      When can we expect this series? 😀

    • @Javatechie
      @Javatechie  3 года назад +1

      Please checkout my reactive programming series

  • @EdwinRebolledo
    @EdwinRebolledo 3 года назад +1

    great explanation! thanks.

  • @sethunest9907
    @sethunest9907 8 месяцев назад

    Hi @java Techie, Is java is purely object oriented programming?

  • @sheshankgolli2667
    @sheshankgolli2667 3 года назад +1

    awesome

  • @ranjanmohanty2788
    @ranjanmohanty2788 3 года назад +1

    Sir app..java ki full series banaiye..jyse..har koi samaj sake..with practical

    • @ranjanmohanty2788
      @ranjanmohanty2788 3 года назад

      Sir.. app java ki. trainning denge kya.. ..we would like to join.

  • @sharad1957
    @sharad1957 3 года назад +1

    thanks basant for nice content
    .please upload video for parallel stream,lazy strems in java8.

  • @sreddy8141
    @sreddy8141 3 года назад +1

    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

    • @Javatechie
      @Javatechie  3 года назад

      Yes

    • @sqb8980
      @sqb8980 2 года назад +2

      But you can make it purely object oriented by only making use of wrapper classes
      Ps: if performance is of no concern

  • @monsterhuntergo
    @monsterhuntergo 2 года назад +1

    Very clear explanation. Thank you very much! Do you also have react js? Thanks.

    • @Javatechie
      @Javatechie  2 года назад

      No React i started but not much

  • @RichaBehera129
    @RichaBehera129 3 года назад

    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

    • @thatoneuser8600
      @thatoneuser8600 2 года назад

      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.

  • @AvinashKumarInsights
    @AvinashKumarInsights Год назад

    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?

  • @mdrashidalam5282
    @mdrashidalam5282 3 года назад +4

    Sir please explain java 11 tutorial

  • @shubhamkumarjha3587
    @shubhamkumarjha3587 3 года назад +1

    Can we create optional of the customer class object ?

    • @Javatechie
      @Javatechie  3 года назад

      Yes we can for list of custom object

  • @praveenreddy9454
    @praveenreddy9454 3 года назад +4

    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

  • @arunbandari8936
    @arunbandari8936 3 года назад

    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...

  • @Srini8174
    @Srini8174 3 года назад +1

    Good explanation,please start on reactjs for backend developer

    • @Javatechie
      @Javatechie  3 года назад +1

      Yes man kunernates and React is my next plan

  • @vaibhavkalgude9316
    @vaibhavkalgude9316 Год назад +1

    If we use Optional.of() when we know the object is not null, then what is the purpose of using it?

    • @Javatechie
      @Javatechie  Год назад +1

      Buddy we never know where we will get null value so to avoid NPE it's good to have it

  • @sarojsahoo8763
    @sarojsahoo8763 3 года назад +1

    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

    • @Javatechie
      @Javatechie  3 года назад +1

      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

  • @goku6272
    @goku6272 3 года назад

    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.

  • @arulrajkumaraselvan3013
    @arulrajkumaraselvan3013 3 года назад

    Why can't we use object.getSomething() ! = null instead of using object.isPresent.Then what's the use of optional class??

  • @siddhilalabobo3597
    @siddhilalabobo3597 3 года назад +1

    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" .

    • @Javatechie
      @Javatechie  3 года назад

      You can use spring jasypt

    • @orangefield2308
      @orangefield2308 Год назад

      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

  • @rk123692008
    @rk123692008 5 месяцев назад +1

    Ways to create Optional class
    empty
    of
    ofNullable

  • @gireeshpoluru3585
    @gireeshpoluru3585 3 года назад +1

    Bro do playlist for java8 streams

    • @Javatechie
      @Javatechie  3 года назад

      Yes it is already there please check in playlist section

  • @sarojsahoo8763
    @sarojsahoo8763 3 года назад +1

    But it can not handle if empty string is returned

    • @Javatechie
      @Javatechie  3 года назад

      Didn't get you

    • @sreesri8492
      @sreesri8492 3 года назад +2

      In that case you need write like this . filter(StringUtils::isNotEmpty). orElse("default")

  • @rishiraj2548
    @rishiraj2548 2 года назад +2

    Please make the ads in the beginning of your videos skippable.

    • @Javatechie
      @Javatechie  2 года назад

      It's not in my hand buddy

  • @ravikumar-ze6el
    @ravikumar-ze6el 3 года назад

    How to filter dates using stream

  • @logeshwarandhanapal6825
    @logeshwarandhanapal6825 3 года назад +1

    Do you have micro services tutorial

    • @Javatechie
      @Javatechie  3 года назад +2

      Yes you can refer this
      ruclips.net/video/tljuDMmfJz8/видео.html
      If you want you can checkout my microservice playlist

  • @expertpic
    @expertpic 3 года назад

    I think Java is not PURELY OBJECT ORIENTED LANGUAGE , there are primitive in java

  • @Mohit-gb9dv
    @Mohit-gb9dv 3 года назад +1

    Kotlin video plzZ

    • @Javatechie
      @Javatechie  3 года назад

      It's already there please checkout kotlin playlist

  • @manishmehta3025
    @manishmehta3025 3 года назад +2

    Are you oriya... you sound like one

  • @NagaSanthosh
    @NagaSanthosh 3 года назад +2

    Content is good but not the accent..

    • @saurabhsharma7942
      @saurabhsharma7942 3 года назад +3

      Ignore the accent, focus on getting the knowledge. It's not costing you a single penny, grab the information for free.

    • @NagaSanthosh
      @NagaSanthosh 3 года назад

      @@saurabhsharma7942 ya I tried my best but still....

    • @Robin-hi4vj
      @Robin-hi4vj Год назад +1

      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.

  • @softwaretestinginterviewqa5192
    @softwaretestinginterviewqa5192 3 года назад

    oriya boy

  • @sanketprajakta
    @sanketprajakta 4 месяца назад +1

    Nice explanation