Java Streams Tutorial

แชร์
ฝัง
  • เผยแพร่เมื่อ 4 ม.ค. 2025

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

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

    ☕Want to master Java? Get my complete Java course: bit.ly/42mQlXE

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

    Awesome video! It only took you 7 minutes 55 seconds to clearly explain this and demonstrate it while it took my university teacher 16 minutes and noone understands. Subscribed :)

    • @kjh-i9r
      @kjh-i9r หลายเดือนก่อน +1

      Took mine almost an hour - and that's why I'm here lol.

    • @NeggesVanMegges
      @NeggesVanMegges 28 วันที่ผ่านมา

      Took mine 1,5 hours…
      At some point you gotta ask yourself what you‘re paying for🫠

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

    This is my first year studying Java and our teacher is just pushing us a lot with extra curriculum related toJava 8 and design patterns. You're helping me grasp this concept a lot. Thanks!

    • @BasicGambler
      @BasicGambler 10 หลายเดือนก่อน +1

      For first year it’s too much don’t stress

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

    I am just binging on your Java tutorials explanations. They are so well explained esp by taking examples. Loved it.

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

    Dude! You are UNDERRATED more people should definitely check out your content!
    Left a sub!

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

    Thanks for the effort. It helped me a lot in understanding how streams work.

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

    5:33 Without streams
    people.sort(Comparator.comparing(Person:: getName))
    You do not even have to collect. So, how come one can say that streams are powerful? Where is the power? I am not against streams. Streams are just a syntactic sugar, a different flavour.

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

    What I got from this, is that streams are pretty similar to Linq in C#, Really powerful tool

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

    Had to venture into our backend for work and this helped clarify a bunch without having to be the JS guy that knows absolutely no Java.

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

    Is this something you would use in your code?

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

      yup, use them every day at work.

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

      Starting to learn it from you, seems more logical, thank you for sharing knowledge

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

      I am definitely going to recommend some of your videos to my tutees. I would love to see you cover Lambda functions sometimes.

    • @tardis2005
      @tardis2005 3 หลายเดือนก่อน

      We are covering this in our advanced Java course right now. I don't see this as cleaner than the usual code. Additionally, it seems to hide much of what is going on. I also don't think this is less work. Would I use it? Maybe. Sometimes.

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

    Can u make complete series on java? u r really an amazing teacher!!!!!

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

    Thank you so much for a clear explanation! Having an exam coming up :)

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

    This is a good extra to our lectures at uni

  • @aravindmuthu5748
    @aravindmuthu5748 9 หลายเดือนก่อน

    As a javascript developer, I find this soothing 😌

    • @jige1225
      @jige1225 5 หลายเดือนก่อน

      😥

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

    lol nice and straight to the point practical example 1:10... Reminds me of the NewBoston tutorials lol which is awesome.

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

    Is there an appreciable performance difference between doing a for loop and using a stream? Obviously there wouldn't be much of a difference in this small example with only 4 items in the list, but is there in larger lists?

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

    Beautiful explanation

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

    Great content as usual! Isn't it the equivalent of map and filters in Python tho?

  • @KrishnaKumar-jr7qq
    @KrishnaKumar-jr7qq 3 ปีที่แล้ว

    This is the video which exactly I am looking for .. Thanks man ❤

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

    Thank you for this very useful video!

  • @Programming-Fun-With-Hima
    @Programming-Fun-With-Hima 4 ปีที่แล้ว +4

    Thank you so much.
    What about performance..??!!

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

    Hi sir, I love your videos it keeps adding a tools in my toolbox ♥

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

    Good introduction and good explanation!
    What is the shortcut for this kind of block comment (2:57)?

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

    Great explanation but just wondering why the Person object is set as a static class?

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

    Hey bro, definitely worth a sub. Nice to see someone just be chill and talkin about coding. Even so, you explain better than 99%, keep it up man, I hope all goes well. I'm also a cal poly student!

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

    Why did I just barely find this!!! 👍👍👍

  • @higiniofuentes2551
    @higiniofuentes2551 8 หลายเดือนก่อน +1

    Altough is interesting, you are limiting the possibility of portability for Java< version 8!
    And this solution is speeding your program or is only for speeding the new developments?
    Thank you!

    • @jige1225
      @jige1225 5 หลายเดือนก่อน +1

      Even "speeding the new developments" - he has to type much more, and for code maintenance, reading is far from straightforward.

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

    starts at 00:00:48

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

    Thanks for great explanation, great video

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

    What Plug-in do you use for the brackets to light up in a different color only when the cursor is nearby? (I'm using IntelliJ IDEA btw) I have a Plug in named "Rainbow brackets" installed but all the brackets are permanentaly colored which I don't like... Good Video btw, helped me alot!

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

    Just started using this in my algorithms and now I'm gonna try and go to my old projects and see if I can update the code and clean it up with streams

    • @jige1225
      @jige1225 5 หลายเดือนก่อน

      😡
      Does not "clean" anything.
      Leave your old projects as they are, time loss.
      Btw it will change your codes, your algorithms I doubt.
      (oops, two years too late)(but I leave it, am pissed off)

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

    iam trying to add the objects from a class to the list by add method just like you did from line 10 to 13 but it wont work

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

    Very useful and helpful, thanks a lot !

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

    great video. need to learn how to do this quickly and this was the fastest one. glad I clicked

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

    Thank you ,its very helpful :)

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

    Thanks! Great video!

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

    Nothing more than a syntactic sugar. What do you mean by "powerful"? How powerful is it? Can you quantify? In python world there is map/reduce/filter. They were also sold as "powerful". It is so powerful that people have stopped using them 😅

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

    If your person class is abstract and you have 2 subclases of person and your list is a list of person and you need to check attributes of suclases, how do yo do this?

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

    Great explanation. Understood

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

    which terminal are you using?

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

    great video, keep it up!

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

    What is the shortcut at 2:58

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

      sure you already found this in the comments ctrl + /

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

    Thnkyou after this I beat the ender dragon in 5mins

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

    so..... java streams are just javascript array operators?

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

    Thanks for this video.

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

    What did you find the best you to amend coding skills?

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

    Not me watching this during my java exam

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

    Thank You. Nice, short and effective lesson. (I’m a beginner…) lol

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

    You can be a good mentor😊

  • @mwatkins0590
    @mwatkins0590 9 หลายเดือนก่อน

    I think it is convenient but no so sure about powerful, it doesnt seem to unlock much new functionality so much as it just removes the need for a for loop to be written out - so it can reduce a bit of "boilerplate".
    However, I think this is very much a double edged sword. I am a rather experienced dev who works with a dev that is rather experienced in another language, and streams have by far been the most obfuscating thing ive seen in our legacy code-bases.
    The examples provided here are fine, I would even recommend using them, but once you have a chain of like 6-10 in a row, and you are using more complicated things like map flatmap and passing in functions as arguments, it becomes a bit of a readability nightmare, and copy pasting it into chatgpt and asking "rewrite this using loops instead of streams" makes it much much more readable.
    readability drastically improves the speed at which coders who are unfamiliar with the codebase can work within it, and should not be underestimated.

    • @jige1225
      @jige1225 5 หลายเดือนก่อน

      it can reduce a bit of "boilerplate" - have you really seen what he types in his first example?!

    • @mwatkins0590
      @mwatkins0590 5 หลายเดือนก่อน

      @@jige1225 what is your point?

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

    What IDE are you using?

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

      it is Intellij IDEA

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

    Love this

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

    well explained, thanks

  • @-mwolf
    @-mwolf 4 ปีที่แล้ว

    Thanks, very helpful

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

    I wish you to keep on coding

  • @szvmczek2342
    @szvmczek2342 9 หลายเดือนก่อน

    you forgot to say that operations on stream can by only do once, after that stream basically closes and you cant do more operations on that stream

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

    Awesome video

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

    hey your videos are great to understand the concept .But it will be very help full if you create videos that go on depth

  • @HocineFerradj
    @HocineFerradj 7 หลายเดือนก่อน

    Imperative programming VS Declarative programming (stream way )

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

    This seems similar to LINQ in C#.

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

    Thanks for the explanation. :-)

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

    wich IDE is this?

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

    Life Saver

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

    Great! Thanks

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

    I'm a JS programmer and...you really use for-loops? ...still?

  • @TinhNguyen-ur8gt
    @TinhNguyen-ur8gt 2 ปีที่แล้ว

    Greate ! Thank you

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

    thanks😍😍

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

    So good thanks "le sang"

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

    Thank you

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

    great , thanks

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

    That was helpful

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

    The background music is annoying ! Does it ever stop?

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

      No

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

    Love it :)

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

    good video, but not really a tutorial for people new to functional programming, it's more like an example of how to use a tiny portion of stream. This video is a bit advanced as it expects you to already know how functional Interface and lambda expressions work.

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

    Dam! this is great

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

    Do a java functional programming ( )-> tutrorial

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

    It's basically LINQ

  • @Cristian-ek7xy
    @Cristian-ek7xy 4 ปีที่แล้ว

    Looks a lot like c# but more boilerplate code

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

    I use something similar in .NET - Linq List

  • @JoseciusDev
    @JoseciusDev 3 หลายเดือนก่อน

    Nanri (Thanks)

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

    There is a lot of info about streams, you didn't cover even 20%.

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

    Ily

  • @yryteny
    @yryteny 8 หลายเดือนก่อน +1

    C:\Program Files\.... Man...

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

    Genius

  • @Dotkt
    @Dotkt 5 หลายเดือนก่อน

    NO! i did not see what you did there.

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

    This looks whole lot like JS

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

    You are printing person.name You forgot to Print hundredClub

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

      Luis Costa hundredClub.forEach loops through the list and prints out all the names.

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

      Keep On Coding yes you are right I did not see that my mistake 😅😁

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

    Great explanation. However, the background music is very distracting

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

    Where is Elon Musk?

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

    you literally haven't explained anything here

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

      😢

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

    Trink mal Vitavate