Java Streams Tutorial | 2020

แชร์
ฝัง
  • เผยแพร่เมื่อ 14 ต.ค. 2024

ความคิดเห็น • 308

  • @ibrahimgunduz34
    @ibrahimgunduz34 3 ปีที่แล้ว +60

    I just met your youtube channel while searching for something regarding spring security but after that, I watched some of your other videos as well. They are definitely awesome. Thanks for your work.

  • @pablodamiannovoarenteria4225
    @pablodamiannovoarenteria4225 4 วันที่ผ่านมา

    This video complements what I was reading about streams, now is time to practice. Congratulations on this, you made so simple the example that you can save hours of reading for some people.

  • @desarrollojava
    @desarrollojava 3 ปีที่แล้ว +33

    This is the best explanation I've ever heard. You have teaching talent man. Thank you.

  • @michaelandcarmenmaguire1108
    @michaelandcarmenmaguire1108 2 หลายเดือนก่อน

    Your style of instruction is truly refreshing. Thank you very much for putting this together. It's fun seeing someone do something that comes naturally to them -- something they're passionate about. That's the vibe I get while watching this and learning from you. I'm definitely going to check out your courses.

  • @florianseidel8574
    @florianseidel8574 4 ปีที่แล้ว +27

    thank you for your work, Nelson. really appreciate it.

  • @mertyertugrul
    @mertyertugrul 4 ปีที่แล้ว +13

    I watch this so many times, thank you Nelson.

    • @ЮрийАндрейцев-й1з
      @ЮрийАндрейцев-й1з 3 ปีที่แล้ว

      so many times? sounds like Nelson awfully explained streams and you have to watch again and again to understand =) i'm joking. Nelson, great job!

    • @mertyertugrul
      @mertyertugrul 3 ปีที่แล้ว

      @@ЮрийАндрейцев-й1з No I just keep forgetting it 🙃

  • @trenvert123
    @trenvert123 2 หลายเดือนก่อน

    I'm glad your tutorials improved over the years. At least for the Spring Boot tutorial. Because this was rough.

  • @mingyungkim3680
    @mingyungkim3680 2 ปีที่แล้ว

    I’m really happy to watch this video. I understood ‘streams’ perfectly that made me annoying. thank u

  • @damahelouni2720
    @damahelouni2720 3 ปีที่แล้ว +3

    Wow, thank you very much. You explain so well and easy to understand. Greetings from Germany 👍🏼

  • @hasangunes9464
    @hasangunes9464 4 ปีที่แล้ว +2

    It's 2020 and I still write code like this. FeelsBadMan

  • @josephthecreator
    @josephthecreator 2 ปีที่แล้ว +1

    Extremely helpful. Stream APIs are so powerful, thank you for breaking this down!

  • @damdl96
    @damdl96 5 ปีที่แล้ว +10

    Easy to understand and great explanation, thank you!

    • @amigoscode
      @amigoscode  5 ปีที่แล้ว

      You are welcome :)

  • @simpleandminimalmaybe
    @simpleandminimalmaybe ปีที่แล้ว

    thank you so much for the brilliant tutorial. may i ask....., are you typing the shortcuts yourself or it is IntelliJ IDEA doing this. I am writing them down by the way for ease of reference. thank you for the effort you put into these tutorials.

  • @martinguerra2142
    @martinguerra2142 3 ปีที่แล้ว +1

    Thank you Nelson, always helping the community!

  • @jakovkusic4219
    @jakovkusic4219 2 ปีที่แล้ว

    Definitely the best video about streams on TH-cam.

  • @peytonpeck
    @peytonpeck 4 ปีที่แล้ว +8

    I was looking for a good video explaining/showing some methods in #stream(), and this was just awesome. 10/10 good job!

  • @CheeseStickzZ
    @CheeseStickzZ ปีที่แล้ว +4

    Nice explanation. But there's nothing wrong with using if ( multiple conditions ) it's actually faster in most cases

    • @Alex-to5vx
      @Alex-to5vx ปีที่แล้ว

      using if statements to make decisions are fine if its a truly binary decision, like if a function is passed a Boolean you can use an if statement because that Boolean value can only ever be one of the other. The functionality is predictable and expandable. However if you are using if statements to make decisions that are more complex all of a sudden you have code that is much less maintainable and prone to errors with any future modifications to the code or requirements of said code. Defining decisions through dynamic dispatch is the proper way of making decisions nowadays even if it is slower because it allows the code to be robust across time.

  • @moodydog9960
    @moodydog9960 2 ปีที่แล้ว +16

    I think with the getAge and getGender in the sort expression, you need to flip getAge and getGender, i.e, do sort by gender first, then by age.

  • @ankit-jangid
    @ankit-jangid ปีที่แล้ว

    Explained very simply and cleared doubts. Thank you so much Amigoscode :)

  • @suwatchainanchai6637
    @suwatchainanchai6637 3 ปีที่แล้ว

    Thank you so much for your tutorial. It help me reduce a lot of code line from doing imperative approach.

  • @RustySilver-w1q
    @RustySilver-w1q 2 ปีที่แล้ว

    Thanks Nelson, I'm appreciate this vids, because when I finished my formation course just learn the base.

  • @cod3rhandl3it
    @cod3rhandl3it ปีที่แล้ว +1

    Articulate, informative, and succinct - WELL DONE and THANK YOU!

  • @Hianfita
    @Hianfita 10 หลายเดือนก่อน

    Excellent video, stream really are insane! Your explanation was mighty understandable. Valeu amigo

  • @FP_95
    @FP_95 ปีที่แล้ว

    Thanks man! Your content is AWESOME! Cheers! :)

  • @AlinaKay47
    @AlinaKay47 3 ปีที่แล้ว +19

    Besides this being a great tutorial, for the first time ever my non-american name is used in an example :')

  • @mirakhmadov
    @mirakhmadov 2 ปีที่แล้ว +1

    Thank you
    You are good at teaching

  • @eddiemarxmallmaalvarez1134
    @eddiemarxmallmaalvarez1134 3 ปีที่แล้ว

    I'm Latinoamerican and could say that Great video man, it's awesome!!

  • @608raju
    @608raju 4 ปีที่แล้ว

    the way you explained is clear. good luck

  • @mkli3459
    @mkli3459 6 หลายเดือนก่อน

    This is very very wonderful! Thanks a lot! 👏

  • @barryalpha4484
    @barryalpha4484 3 ปีที่แล้ว

    This is the best explanation that i have ever had. thank you a lot guy for this beautifull job.

  • @vpenywise
    @vpenywise 2 ปีที่แล้ว +2

    4:19 - doesn't appear to be free anymore, but then again, I'm a few years late watching the video :D Thanks for the content nonetheless! I will also check your website and courses for sure!

  • @fabiovictorino350
    @fabiovictorino350 ปีที่แล้ว

    It's was amazing. I love so much yours videos.

  • @abhijeetprabhu4117
    @abhijeetprabhu4117 4 ปีที่แล้ว

    Followed you from your FCC video on Spring. Thank you for such an informative session! Subbed

  • @rabbyhossain9537
    @rabbyhossain9537 2 ปีที่แล้ว

    Best website for learn coding

  • @abrehamish
    @abrehamish 4 ปีที่แล้ว +3

    Thank you Nelson for excellent expalnation.

  • @DaRolla2016
    @DaRolla2016 4 ปีที่แล้ว +3

    Hi Nelson, thanks for this. Can you please explain how to get images into your comments? Like // Imperative approach ❌ and // Declarative approach ✅ ? My IDE does not show them right like the Github Webpage does. But in your video your IntelliJ did ?!

  • @yeso3716
    @yeso3716 3 ปีที่แล้ว +4

    I was wondering why the output of sorted didn't change after you added thenComparing(Person::getGender()) to the method at 9:00 ?

    • @ImAmericanGangsta
      @ImAmericanGangsta 3 ปีที่แล้ว +2

      for thenComparing it should do changes if we have two persons or more with same ages so females will appear first

    • @worldwide6626
      @worldwide6626 3 ปีที่แล้ว +3

      @@ImAmericanGangsta yeah it was a bad example. He should have sorted by name instead

  • @sumanthmuttuvalli4931
    @sumanthmuttuvalli4931 3 ปีที่แล้ว

    Thank You, Nelson. Your videos are very helpful to me.

  • @TheN0odles
    @TheN0odles 3 ปีที่แล้ว

    Hey bro, grettings from Johannesburg. Good work, man!

  • @prakhar.odyssey
    @prakhar.odyssey 3 ปีที่แล้ว

    Thank you for this amazing explanation brother! 😄🙌🏾

  • @kostiantynkarzhanov9216
    @kostiantynkarzhanov9216 8 หลายเดือนก่อน

    Thank you! Very very helpful! 💛

  • @prashantvaghela3337
    @prashantvaghela3337 2 ปีที่แล้ว

    Thank you for this amazing video on Streams in Java. I would like to know your learning approach to new concepts. How do you learn about all these concepts? What's the secret recipe?

    • @techBuffy
      @techBuffy ปีที่แล้ว

      Buy a book and study.. There is no magic recipe for building concepts.. Free Videos have limitations

  • @teofilomassinga7528
    @teofilomassinga7528 3 ปีที่แล้ว

    Thanks, Nelson
    you are a wonderful teacher.

  • @abulka
    @abulka ปีที่แล้ว

    You can do exactly this kind of thing in JavaScript and Python etc so simply, without the excessive syntax that Java needs.

    • @gintoki_sakata__
      @gintoki_sakata__ 4 หลายเดือนก่อน

      That's fine.. as long as it gets done

  • @fredericochopin
    @fredericochopin 3 ปีที่แล้ว +1

    Nelson, this is great stuff! Thank you.

  • @tshepo2japhta28
    @tshepo2japhta28 4 ปีที่แล้ว +1

    Man you inspire me ...keep them coming

  • @peasantfolkhero
    @peasantfolkhero ปีที่แล้ว

    You have my thanks, you are doing this very well.

  • @kihunkim7498
    @kihunkim7498 4 ปีที่แล้ว

    very useful video and simply explained. Thank you so much bro!!

  • @ninobach7456
    @ninobach7456 ปีที่แล้ว

    in classical java fashion, complexity gets added left and right

  • @MrZbieg1422
    @MrZbieg1422 ปีที่แล้ว

    Thanks dude. You just saved me some time :D

  • @gurushashank7863
    @gurushashank7863 2 ปีที่แล้ว

    Thank you, Helped me a lot 😃

  • @IvanPallaresTrivino
    @IvanPallaresTrivino ปีที่แล้ว

    I see this all over the place in Java world but, why not splitting those chains in methods with proper names to improve readability? I think that would make Martin Fowler happy 😄
    Thanks for the great explanation!

  • @hamza-the-big-data-lad
    @hamza-the-big-data-lad 3 ปีที่แล้ว +1

    Please, make a video on Map vs FlatMap. Thank you!

  • @Netalon
    @Netalon 3 ปีที่แล้ว

    Thank you Bro ! Finally i learned streams in Java

  • @sk1708
    @sk1708 3 ปีที่แล้ว

    ASK Brother, do you give personal training too?

  • @Jody-nf2bz
    @Jody-nf2bz ปีที่แล้ว

    Excellent class. Thank you!

  • @Panerakis
    @Panerakis 5 ปีที่แล้ว

    Thanks for the tutorial, it is concise and well structured. What about the performance of this method compared to the imperative approach?

    • @amigoscode
      @amigoscode  5 ปีที่แล้ว +2

      Its tuned for performance too

  • @andreas-fefe
    @andreas-fefe 2 ปีที่แล้ว

    Hello Neloson thanks for your interesting and well explained concepts. please would like to know how to come out with printing only one property of the person after sorting.

  • @eduardohenriquedeassis9729
    @eduardohenriquedeassis9729 2 หลายเดือนก่อน

    Amazing video Bro!

  • @vitorgsevero
    @vitorgsevero 2 ปีที่แล้ว

    Great explanation! Thank you so much!

  • @FukSN
    @FukSN 2 ปีที่แล้ว

    Thanks Nelson.
    Just learning Java for my job and I work with Collections/Lists a lot so this is super helpful.

  • @K.E.N.J.I.B.A.B.Y
    @K.E.N.J.I.B.A.B.Y 2 ปีที่แล้ว +1

    This was very infomative! I followed along with my own custom made class and I learned a ton! Thanks a million!

  • @anantpillai4656
    @anantpillai4656 5 ปีที่แล้ว +3

    Seriously well explained!!

  • @juzerkhambati5068
    @juzerkhambati5068 4 ปีที่แล้ว

    Hi, You really explain so well. Really appreciate it. Thank you

  • @mailtoharutyunyan
    @mailtoharutyunyan 2 ปีที่แล้ว

    Hi @amigoscode, Can you tell me how I can trim strings in the list which are in Ticket class for example, and sort them in ASC order?

  • @luffyonepiece4526
    @luffyonepiece4526 4 ปีที่แล้ว

    I got plenty of review comments on streams to not to use them on production code unless ur doing parallel and non-blocking operations. So do u use in production code? If yes what could be scenario u used? By the way thumps up to ur video.

    • @amigoscode
      @amigoscode  4 ปีที่แล้ว

      ahaha something is wrong with you team mates then lol we use streams all over the place. I have only seem once or twice people using parallel streams.

    • @swsessaji
      @swsessaji 4 ปีที่แล้ว

      I too got the same comments stating that for a short/small collection, classic for each block has more advantage over streams on the basis of processing power & space used.
      Streams takes up more time & could only be beneficial for huge & complex collection

  • @simranpreetkaur7840
    @simranpreetkaur7840 ปีที่แล้ว

    Great content, well structure and quality content. Keep posting :)

  • @juanignaciorios4513
    @juanignaciorios4513 4 ปีที่แล้ว +1

    Eres un crack!! Thanks and greetings from Argentina🇦🇷

  • @jopadjr
    @jopadjr 3 ปีที่แล้ว

    Thanks mate for the tutorial...

  • @carlozuk
    @carlozuk 3 ปีที่แล้ว

    Amazing video, can't wait to take the course

  • @dmytrog6127
    @dmytrog6127 4 ปีที่แล้ว

    Thank you! Very clear, very understandable, very comprehendly

  • @angecarmelyoro6321
    @angecarmelyoro6321 3 ปีที่แล้ว

    What a masterclass. Thank you Nelson

  • @PhanTanThangTH
    @PhanTanThangTH ปีที่แล้ว

    Thank you so much bro, keep it up :)

  • @EmanAl-Murish
    @EmanAl-Murish ปีที่แล้ว

    Woow, thank u so much for this Amazing video

  • @BrilliantMindsZw
    @BrilliantMindsZw ปีที่แล้ว

    quite clear and understandable

  • @brunocardoso8246
    @brunocardoso8246 4 ปีที่แล้ว +2

    Appreciate simple and structured explanation. Thank you !

  • @ainbrisk545
    @ainbrisk545 ปีที่แล้ว

    thank you! very insightful

  • @foleyjack
    @foleyjack 4 ปีที่แล้ว +1

    Very well explained, good tutorial, thank you

  • @coelho8276
    @coelho8276 3 ปีที่แล้ว

    best video for java streams

  • @adamfaisal1750
    @adamfaisal1750 3 ปีที่แล้ว

    Many Thanks Dear Nelson

  • @andresencolombia
    @andresencolombia 2 ปีที่แล้ว

    Great job Amigo.

  • @Alberto_Cavalcante
    @Alberto_Cavalcante 2 ปีที่แล้ว

    Grande Nelson!

  • @ColjaCarls
    @ColjaCarls 3 ปีที่แล้ว +2

    Thank you! But what about performance? What if there is a large list of T that I want to make different calculations and groupings on? In "normal" code I would iterate the list once and do all the stuff with each element. How would that look like with Java streams if I do not want to iterate the list more than once? E.g. imagine a list of people. I want to create a Map that maps from e.g. the city to a List of People. I also want to have Lists for each gender. Would that mean I have to have 3 streams, each resulting in one of the containers? And what about performance? Thanks in advance!

    • @evanskemboi79
      @evanskemboi79 ปีที่แล้ว

      Hey Colja, I do not think you need three different streams. You can run filter more than once in one stream. All you need to do is to change the predicate on each filter to match your criteria. For that matter, you will Iterate the list only once. I do not know much, but that's all I can say about your question.

  • @lifeTechnicolorGuy
    @lifeTechnicolorGuy 5 ปีที่แล้ว +1

    Great tutorial ! I will do the course for sure.

  • @dannygavrieli4940
    @dannygavrieli4940 2 ปีที่แล้ว

    What is the shortcut for extracting a variable?
    Thank you.

  • @ctx4241
    @ctx4241 2 ปีที่แล้ว

    It'd be great to include explanation WHY not only how. Imperative > Declarative does not say anything to anybody. It is hardly shorter codewise then forE way. Point of streams is that the operations can be done in parallel with drawback that setting up stream takes some time. Therefore setting up stream for huge list is worth it because of parallel nature of operation, while this couple item long list you are probably just wasting time on typing I believe?

  • @streamcoders3552
    @streamcoders3552 2 ปีที่แล้ว

    OMGGG DUDE>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> AWESOME

  • @senss3000
    @senss3000 2 ปีที่แล้ว

    awesome bro thnks ! we want more

  • @aveshkadri
    @aveshkadri 3 ปีที่แล้ว

    thanks amigo, very well explained

  • @houariboumediane3536
    @houariboumediane3536 6 หลายเดือนก่อน

    That was good man...thanks.

  • @fil-v1
    @fil-v1 4 วันที่ผ่านมา

    Great video!

  • @swsessaji
    @swsessaji 4 ปีที่แล้ว +1

    Although streams have greatly reduced code lines what are its actual advantages with respect to processing time & speed & space consumption ?

    • @UsernameNULL755
      @UsernameNULL755 4 ปีที่แล้ว

      as far as i know, they are much better when working with large amount of data.

    • @JoaoSantos-ke8dq
      @JoaoSantos-ke8dq 2 ปีที่แล้ว

      They can be 5x slower.

  • @f3rdi881
    @f3rdi881 4 ปีที่แล้ว

    That's intelliJ yeah? How did you create the list variable with what seemed like pressing 1 button? Also changing the lambda to a method reference?

    • @amigoscode
      @amigoscode  4 ปีที่แล้ว +1

      Check my course on IntelliJ on TH-cam or my amigoscode.com/courses

  • @hansmustermann4206
    @hansmustermann4206 3 ปีที่แล้ว

    nice explained, but you must agree, that "thenComparing()" only makes sense, if the first comperator produces any doublettes, dont you?

  • @DEVKA777
    @DEVKA777 4 ปีที่แล้ว

    thank you for your work! so cool and understandably

  • @sumanmishra5712
    @sumanmishra5712 4 ปีที่แล้ว +2

    hello bro, it says page not found after clicking the link on gmail after registering on your free course!!

  • @MaxGyn2023
    @MaxGyn2023 4 ปีที่แล้ว

    Nelson thanks for the lesson! By the way where are you from?

    • @amigoscode
      @amigoscode  4 ปีที่แล้ว +1

      You welcome. 🇬🇧

  • @aobaidi5626
    @aobaidi5626 3 ปีที่แล้ว

    The best, brother

  • @luisdfernandez2601
    @luisdfernandez2601 4 ปีที่แล้ว

    Nicely explained. Nice work!

  • @russellskalden8064
    @russellskalden8064 4 ปีที่แล้ว

    Like your lessons, keep going 👍