Sets: Java Collections Framework Tutorial Part 5

///Sets: Java Collections Framework Tutorial Part 5

Sets: Java Collections Framework Tutorial Part 5

FavoriteLoadingAdd to favorites

More courses! Free C++ course:
Make a social network with Spring Boot:
Learn about MySQL and relational databases:
Java desktop programming:
Intermediate-Advanced C++ 11:
——————————————————————————————————————————————-
How to use sets in Java — HashSet, TreeSet and LinkedHashSet. In this tutorial I also explain how to find the intersection of two sets and the difference of two sets, as well as the usual stuff – iteration, adding and removing items and so on.
——————————————————————————————————————————————–
More videos on my YouTube channel:

source

Java468x60
By |2020-04-17T02:59:47+00:00April 17th, 2020|Java Video Tutorials|46 Comments

46 Comments

  1. Siqi Yang April 17, 2020 at 2:59 am - Reply

    Really, the accent does matter. I subscribe because of your pronunciation.

  2. Khalil Béjaoui April 17, 2020 at 2:59 am - Reply

    This damn video amounts to nearly 60% of my exam 😀
    Thank you.
    and I learned what an Aardvark is, which is always a bonus.

  3. Subhasish Nath April 17, 2020 at 2:59 am - Reply

    Thanks for the tutorial.

  4. jvsnyc April 17, 2020 at 2:59 am - Reply

    The third of the operations, besides intersection, which is symmetrical, set difference, which you showed here, is of course Union. I can immediately think of a couple of ways that we could do it, but you could mention which is the "best" or recommended way of obtaining the union of two sets or "adding" one to the other.

  5. sakuray7 April 17, 2020 at 2:59 am - Reply

    This is great!!

  6. Forge of Innovation April 17, 2020 at 2:59 am - Reply

    .

  7. HAMROUNI Zied April 17, 2020 at 2:59 am - Reply

    old fuck lol

  8. andrei alexandru April 17, 2020 at 2:59 am - Reply

    Mister John, thank you very much!

  9. GabriP April 17, 2020 at 2:59 am - Reply

    thank you, on 15 minutes you did what my professor couldn't do, that was explain this subject, IN AN HOUR
    thank you very much, feel much more confident for the test now

  10. LifeSuxTR April 17, 2020 at 2:59 am - Reply

    this guy is legend.Looking for some videos about building real world projects.(make them paid :)) )

  11. My Hops April 17, 2020 at 2:59 am - Reply

    You are the best teacher ever! Even in college my professors could not explain as well as you. Thank you lots John 😀

  12. Akshay Sapra April 17, 2020 at 2:59 am - Reply

    you should ave kept the piano music all video long

  13. Hiyam Ghannam April 17, 2020 at 2:59 am - Reply

    That was actually Awesome

  14. hmmm April 17, 2020 at 2:59 am - Reply

    Awesome tutorial. Thank you!

  15. GMByte Java April 17, 2020 at 2:59 am - Reply

    Thank you! I just realised what a stupid way I used writing my program which compared two text files and then said what the differences between them are. I could use the Set collections instead of ArrayList to avoid a big code with a lot of loops which check what matchs and what doesn't!

  16. etelot April 17, 2020 at 2:59 am - Reply

    How would you apply this to your own class? I have a employee class that is implementing comparable, but when I try to add(new Employee("Name", 12323, 12, 12, 192), it only add one to the treeset.
    I do this: mystreeset.add(new Employee("name", salary, hireday); many times, but when I print it only the first one get printed out, and the size is also only one. Any idea?

  17. meaty jam April 17, 2020 at 2:59 am - Reply

    What da fuck

  18. Jack Powell April 17, 2020 at 2:59 am - Reply

    This was great thank you. Really helped me understand the concept of sets! You're saving me on this late assignment!

  19. Davit Harutyunyan April 17, 2020 at 2:59 am - Reply

    Thanks for Tutorials))

  20. Alankar Anand April 17, 2020 at 2:59 am - Reply

    what's with the music and that voice (it's really irritating).Please try to talk like you are having a casual conversation.

  21. Kirk Rohani April 17, 2020 at 2:59 am - Reply

    Yes I also think that it's johny Ives!!

  22. Suzan Suzan April 17, 2020 at 2:59 am - Reply

    thanks , your videos are perfekt, you help me very ))) for all this I needed longe time, and I see now it is very simple , i wish you good luck

  23. Giorgi Modebadze April 17, 2020 at 2:59 am - Reply

    Great job. Thanks to this tutorial, I now know much more about Java Sets and aardvark – a medium-sized, burrowing, nocturnal mammal native to Africa; only living species of the order Tubulidentata.

  24. Bishal Chhetri April 17, 2020 at 2:59 am - Reply

    I used hash set and it retained order.

  25. Carl Hopkinson April 17, 2020 at 2:59 am - Reply

    If your code is dependent on properties not defined in the interface but only the implementation, you shouldn't abstract away that information by referring to an
    implementation instance by its interface.

  26. ramji tiwari April 17, 2020 at 2:59 am - Reply

    Hello John, I really like you videos !! Thanks for fantastic work 🙂

  27. Nasko Lapchev April 17, 2020 at 2:59 am - Reply

    you are the best great work thk

  28. Ted Chirvasiu April 17, 2020 at 2:59 am - Reply

    Thank you very much! Awesome tutorial. The opera music and the very soothing voice makes me picture you like a sloth. A very classy sloth with a monocle and a gentleman hat.

  29. Daniel G C April 17, 2020 at 2:59 am - Reply

    you are the best, :).

  30. Eugen Hildt April 17, 2020 at 2:59 am - Reply

    Hi John, i just so total looooooovvveeeeee your tutorials. You are awesome! Thank you so very much for teaching/sharing your knowledge!!! 😀 

  31. M ALI April 17, 2020 at 2:59 am - Reply

    The order i got – it worked nicely 
    HashSet: 9 [Cactus, Lilly, Lemon, Apple, Pineapple, Rose, Jute, Banana, Jasmine]
    LinkedHashSet: 9 [Apple, Banana, Lemon, Cactus, Jute, Rose, Jasmine, Lilly, Pineapple]
    TreeSet: 9 [Apple, Banana, Cactus, Jasmine, Jute, Lemon, Lilly, Pineapple, Rose]

  32. Radoslav Andonov April 17, 2020 at 2:59 am - Reply

    I know you can iterate over the set with Iterator. When I should use Iterator over foreach loop and vise verse 

  33. Darian Perez April 17, 2020 at 2:59 am - Reply

    Excellent video. Thank you very much

  34. Caesar__ April 17, 2020 at 2:59 am - Reply

    The damn opera music and "sophisticated" voice makes me wanna go to sleep.

  35. Bharat Bawari April 17, 2020 at 2:59 am - Reply

    Really nice, crisp and to the point..thank you very much.

  36. Bobo Jack April 17, 2020 at 2:59 am - Reply

    dude thanks! helped me out a lot. Exame in two days 😀

  37. larn555 April 17, 2020 at 2:59 am - Reply

    you can use the diamond operator with newer version of java

  38. Rastenwolf April 17, 2020 at 2:59 am - Reply

    Cool presentation 😀

  39. Cave of Programming April 17, 2020 at 2:59 am - Reply

    addAll()

  40. Sahil Rally April 17, 2020 at 2:59 am - Reply

    Awesome :-). How can we do union of two sets in best efficient way ?

  41. Ali Mizan April 17, 2020 at 2:59 am - Reply

    that's pretty much everything I needed to know about sets all in 15 concise minutes. Thanks for uploading!

  42. madhu attri April 17, 2020 at 2:59 am - Reply

    Great………………………

  43. Hoto April 17, 2020 at 2:59 am - Reply

    I use syso ;P
    but I can pronounce it, can You?

  44. MegaPega41 April 17, 2020 at 2:59 am - Reply

    Thank you!! Such a big help 😀

  45. Mateusz Almannai April 17, 2020 at 2:59 am - Reply

    Most excellent tutorials. I am speechless.

  46. Cave of Programming April 17, 2020 at 2:59 am - Reply

    Type sysout and press ctrl+space. Or in Netbeans type sout.

Leave A Comment

*