Set and HashSet in Java - Full Tutorial

preview_player
Показать описание
Full tutorial on Sets and HashSets in Java!

What exactly are Sets and HashSets in Java? How are they different? How do you use them, and how are they different from Lists and ArrayLists?

We'll learn all about Sets and HashSets (and other types of sets like TreeSets and LinkedHashSets) in this video.

Learn or improve your Java by watching it being coded live!

Hi, I'm John! I'm a Lead Java Software Engineer and I've been in the programming industry for more than a decade. I love sharing what I've learned over the years in a way that's understandable for all levels of Java learners.

Let me know what else you'd like to see!

Links to any stuff in this description are affiliate links, so if you buy a product through those links I may earn a small commission.

📕 THE best book to learn Java, Effective Java by Joshua Bloch

📕 One of my favorite programming books, Clean Code by Robert Martin

🎧 Or get the audio version of Clean Code for FREE here with an Audible free trial

🖥️Standing desk brand I use for recording (get a code for $30 off through this link!)

📹Camera I use for recording:

🎙️Microphone I use (classy, I know):

Donate with PayPal (Thank you so much!)

☕Complete Java course:

Рекомендации по теме
Комментарии
Автор

Let me know if you have questions, or ideas for another video!

CodingWithJohn
Автор

Not all heroes wear capes. John is out here saving grades.

evelinechaza
Автор

The fact u used breaking bad char names made u the goat, thanks for this John

xbz
Автор

Hi John! I'm a student of systems engineering. I'm from Colombia and your videos are making me improve in this language. Thank you!

juanjaimeszuluaga
Автор

Thank you, John! Also, I loved the Breaking Bad characters being incorporated into the lesson.

CoffeeDev
Автор

Another high-quality video, John. It actually came at the perfect time for me. I was making a whole lot of spaghetti code with ArrayLists and for loops, but then I realized that I need to focus on learning data structures for a while. This very lesson just happened to be applicable to a project I'm working on right now. I'm messing with an API that gives me random cat facts, and I've been getting a lot of duplicates.

socaljusticewarrior
Автор

I had to learn Java for a new job last year and while many of the concepts like Hash Sets have one-to-one parallels in other languages I’ve used, I’ve yet to read up on how to implement them in Java. This tutorial easily saved me a couple of hours of textbook reading. Keep up the great content.

galdamez
Автор

In my opinion, John is the best programming mentor on YouTube platform! Thank you so much, John!

tfnowru
Автор

What i couldn't understand from 1 hour long lectures, this guy just taught me under 30 mins hatss offf

anubratsahoo
Автор

Hello John! While I am an experienced Java Developer, I like watching other videos and tutorials to see what is either new, or if I missed anything as I am self-taught (Or just for fun because it is entertaining and informative like your videos) and around 6:29 when you were talking about ordering being maintained is somewhat untrue
ArrayLists do not maintain order and just like HashSet, they can be in whatever order Java decides to put them in. Generally speaking, Lists do maintain order a bit better than HashSets. The collections for both List and Set that maintain order is LinkedList and LinkedHashSet respectively. These will maintain their order of being added.

FirestarMinecraftMore
Автор

Hey John! Your videos are helping me get through the most important internship of my life. THANK YOU. Humble Request: can you make a video covering

jordanparsa
Автор

It’s amazing having access to Java tutorials with the same quality and enthusiasm other YT channels give to the likes of Rust or the latest JavaScript framework. Thank you John!

telerobotic
Автор

Hi Dear Sir ! I'm associat java developer, and I love the way you delivered the topics, especially Hashset and HashMap because I was so confused on these before I watched your tutorials
Thanks ❤

shafaatalizee
Автор

even though i knew all about java sets, i still watched this video to appreciate how well you teach these concepts.

keep it up youre doing good work for the java community 🙏

trustytrojan
Автор

John, thank you so much for the Java lessons. As someone who is not fluent in English, having to read the error-filled YouTube captions and follow the lesson at the same time, I actually understand your explanation better than my own professor's. Sending a warm embrace from Brazil!

guzinreidelas
Автор

I can't believe you just uploaded this video haha
I am studying CS and this week's homework has to do with Collections and HashSet 😂

SemiWagner
Автор

As a senior dev, i must say, watching your videos is very relaxing. Thank you.

evilman
Автор

Da man is back! This dude has saved my Java bacon many times! These videos are the best.

gerdsfargen
Автор

Man respect ++, The clarity you gave was commendable !

ayushmaansural
Автор

Thanks a lot for the simplicity!
One question: while using hashset which way should we prefer and why:
1 - Set s = new HashSet
2 - HashSet hs = new HashSet

anpadjahil