Map and HashMap in Java - Full Tutorial

preview_player
Показать описание

Maps and HashMaps in Java can be so confusing when you're first starting out your Java career.

But Maps and HashMaps don't have to be confusing at all! A Map is a simple, powerful tool to have in your programming arsenal, and this video will give you everything you need to know to use Map and HashMap confidently in Java, even if you're a Java beginner.

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!)

📹Phone I use for recording:

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

Donate with PayPal (Thank you so much!)

☕Complete Java course:

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

Super underrated channel. With how little views your videos currently get, I'm surprised YouTube even recommended them to me! You deserve a lot more viewers for how well you explain things, and I hope your channel gets the recognition it deserves soon enough

gur
Автор

the one thing i like about this channel is he doesn't waste any time. you can see he edits out speech pauses and filler words. very concise and engaging.

millenialmusings
Автор

I am a first year software development student and there are a bunch of stuff they didn't teach us. This video is quite useful! Thanks!

yuto
Автор

I don’t understand how you can explain this stuff so easily. Seriously a true talent. Can’t thank you enough for the videos

youthought
Автор

man please.. please keep it up with ur videos.. they are amazing.. I am in the middle of a java bootcamp and they are really helping me out

pedroaboffa
Автор

man if only my cs class was set up and taught like John. he explains all these topics, in the best simplest ways! love these videos!

peterswrath
Автор

Sir, I’ve been binge-watching your videos for the last three days. You make it all so very simple and clear. Thank you.

CarlosCed
Автор

I tell you now. You will become top code YouTuber

shoaibaltaf
Автор

Your tutorials are bingeworthy. I already know and use Java but in all of your tutorials, I do get to learn a thing or two. Keep up the good work! 👍🏼👍🏼

shahoodgmail
Автор

I have recently discovered this channel, and to be completely honest, it's an awesome channel to learn from. I have seen many channels teaching Java, but this one is different, the way the John teaches is captivating and holds your attention throughout the video. The videos are informative yet concise, and everything is presented clearly and accurately. I have been going through all the videos.

azadassis
Автор

2:28, now in C# you can infer even more, and you would be able to write your Java as: HashMap<String, Integer> empIds = new();

BernardVisagie
Автор

Man... You are hidden diamond 💎 in YouTube and I found you very You deserve more views than any other java related videos.... I am from India.

venkat
Автор

Thank you so much John! Your videos are great! I love how I can learn what I need in just 10 minutes as opposed to the typical school setups we have all experienced in other venues that takes hours and leave you confused.

carriewright
Автор

I took notes to make myself a cheat sheet from this and work on my typing speed. Love these videos!

HashMap <Key Type, Value Type> name = new HashMap<>();



name.put([key object or value], [Value or object]);

adds a Key and a Value to the hashmap





System.out.println(name);

[Outputs:

"{Key=Value ....}"





[Outputs: Value associated with Key]





Prints Boolean answer to inquiry -- does the "key" exist in the map? True.



Prints whether or not map contains "value"

Put overrides previous calls to put method on the same key

hashMapName.replace("key", Value);

will replace entry for key, but does not create new entries

HashMapName.putIfAbsent(key, value);

adds the key and value to map, if absent

JacobLoneWolfin
Автор

This video literally equals to an hour of studying trying to understand Map. You are amazing! Please never stop what you are doing. You actually make us beginners understand and well hopefully making us the future IT people (:

flytoinfinityvivi
Автор

in ten minutes i am able to learn which others explain in double or triple amount of time and comprehended 95% of the video content, thanks to your explanation, thank you john sir

aryanjoshi
Автор

Hey John.

I've been watching your videos for the last few hours and so very glad I found you.
I'd been struggling with making LinkedLists and HashMaps make sense in my head and your explanations + examples struck a note with me.

Thanks a lot.

zlyglco
Автор

Thank you so much! I've got this massive project due in a few days!

mattmalan
Автор

I have a test coming up tomorrow and this guy is literally saving my life by making things simple and clear to understand. THANK

crookedcrowe
Автор

Why do you not have a lot more subscribers? You have helped me so much and you deserve to have a lot more. Thanks for helping me out on so many things!

ReallyAqua