Map and HashMap in Java - Full Tutorial

Map and HashMap in Java - Full Tutorial

Coding with John

3 года назад

679,791 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

@Lalovoe
@Lalovoe - 22.04.2025 15:21

super goated explanation

Ответить
@dutch_gbg2071
@dutch_gbg2071 - 09.04.2025 03:39

LinkedIn account??

Ответить
@sm22446
@sm22446 - 29.03.2025 09:35

You literally saved me thank you

Ответить
@DiaborMagics
@DiaborMagics - 28.03.2025 20:19

Ahh brilliant. In a lot of cases I've been making multiple arraylists and updating them all, but it can be hard to track everything or to go back and change them. I guess you can't assign multiple values to a key and would just need to make it a class/object if you want that?

And is it possible to manipulate/sort the way it's printed instead of just printing it as the 'strange' order that happens because it only stores things?

Ответить
@Madworld130
@Madworld130 - 27.03.2025 12:43

Missed the opportunity to use the name Jenny with 8675309 😂

Ответить
@pratappratihar8198
@pratappratihar8198 - 22.03.2025 13:25

Thanks so much, for explaining everything in such a easy way........ There is not a single channel thats doesnt make it look over complicated...... Thnak god i found this Channel....Subscribed now for life.

Ответить
@tommygunmitvierm724
@tommygunmitvierm724 - 20.03.2025 15:03

I don not really understand the use cases you explain in the end. They all sound to me like things I would store in an object of a class (e.g. the birthday of a pet). I know this might be just how I think about coding but when would you actually prefer a map over a class? I assume it is more performant but again I find it hard to grasp on when you even know to value performance over modularity and "clean" code.

Ответить
@Anikvahora74
@Anikvahora74 - 16.03.2025 22:39

Brother brother i never comment on a video but i have watched many coders now and has created brainrot you were the best best best a-i understood every single thing here thanks man you just gained a big subscribe

Ответить
@37drin11
@37drin11 - 14.03.2025 16:44

Nice video!

Ответить
@Amandarileymusic
@Amandarileymusic - 14.03.2025 05:53

This is the best explained HashMap video for Java. I'm currently cramming data structures and would appreciate well-explained videos on other data structures in Java like stack, queue, tree, graph, heap... I saw your video on sets too.

Ответить
@Ghifaro
@Ghifaro - 12.03.2025 16:54

makasih bapak johnny sins, saya jadi paham mangenai hashmap, bless u and keep shinning

Ответить
@LiamDavode
@LiamDavode - 20.02.2025 21:39

damn you talking fast :(

Ответить
@giannidelbaretto04
@giannidelbaretto04 - 17.02.2025 00:01

Very clear and to the point explanation. The only problem in a realistic scenario is that a map can't have the same key twice, so using Strings (especially names) is not recommended. It's better to use unique IDs (a String or an Integer wrapper class) as keys for each value and anything you want as value. In the example of employees hashmaps, you can use as values the names, or even custom Employee objects containing all the data of each employee.
Obviosly it's only one way of fixing this risk, another way is to use the objects (for example Employee) as keys and data (for example an Integer salary) as value.

Ответить
@vaggelisrevolted7335
@vaggelisrevolted7335 - 15.02.2025 10:42

DeepSeek suggested your video when I asked about maps in Java. You have the AI by your side :P Great content

Ответить
@AishwaryJain-l2l
@AishwaryJain-l2l - 29.01.2025 12:10

To the point, Just usecases, ThankYou bro

Ответить
@AnthonyAkaigwe-x4x
@AnthonyAkaigwe-x4x - 25.01.2025 04:17

Congratulations I nailed the certification test

Ответить
@kestans
@kestans - 22.01.2025 13:07

Congratulations- after long time it You nailed it our 10th level of recruitment stage, but sorry we cannot hire you John Brown for a junior dev position because our employee hashmap only allows a replace - so there as it we already have another guy with a same name a senior dev John Brown - we dont want to replace him - good luck finding another company.

Ответить
@Naranja93
@Naranja93 - 08.01.2025 16:02

great to refresh my knowledge on maps, thank you!

Ответить
@samaboyyy
@samaboyyy - 31.12.2024 02:42

Its crazy how you explain better than my lessons 😭

Ответить
@EricByrd-v1u
@EricByrd-v1u - 16.12.2024 02:07

Thank you so much! This was super helpful and was exactly what I needed.

Ответить
@Catherine-g1u3s
@Catherine-g1u3s - 02.12.2024 13:55

Excellent to learn from

Ответить
@humna04
@humna04 - 29.11.2024 22:57

what ide ?

Ответить
@kzzazzip6272
@kzzazzip6272 - 28.11.2024 11:56

You are the man

Ответить
@ksricharan408
@ksricharan408 - 25.11.2024 10:37

Love the carl animation whenever you say his name😂

Ответить
@gamisr2848
@gamisr2848 - 05.11.2024 18:36

Great video. Understood and could follow along after being introduced to this in class. Subscribed!

Ответить
@senirudinil
@senirudinil - 02.11.2024 04:52

thanks jhon

Ответить
@teosurch
@teosurch - 31.10.2024 01:43

Thank you for this clear and easy explanation!

Ответить
@СергейКонар-д7р
@СергейКонар-д7р - 15.10.2024 16:42

And what about map collision?

Ответить
@Admszki555
@Admszki555 - 04.10.2024 18:24

This was so helpful. Thank you !

Ответить
@dessa8242
@dessa8242 - 29.09.2024 23:50

I didn't know why you have fewer subscribers, I am the kind of person who does not understand things right away, but your video is so simple, and precise. I will understand if you do some rocket science courses too haha. Anyway, you are so smart enough and can readily explain things.

Ответить
@andyrockstar78
@andyrockstar78 - 15.09.2024 20:04

Such a great explanation. Thanks

Ответить
@khawamessa5794
@khawamessa5794 - 05.09.2024 12:31

Thank you very much for this video. Can you please explain the difference between Map (HashMap) and a two dimensional array. Both seem to be exactly the same to me

Ответить
@yagotevez-prog
@yagotevez-prog - 20.08.2024 11:56

If you had to use a HashMap to make a program that tells you the line numbers where each word in a text appears, what would be the keys and what would be the values ?

I mean, I guess the values would be the words (strings) of the text, but what about the keys ?

Ответить
@gird4p
@gird4p - 12.08.2024 14:41

You made my day with this simple explanation. Thanks! <3

Ответить
@AtulPal-i5s
@AtulPal-i5s - 08.08.2024 10:54

It's an amazing video it explains how to use hashmaps in pretty short video. I'm learning springboot and I don't know about hashmaps so it really helps me to understand how the hashmap works and now I can use it.

Ответить
@peachyflava4309
@peachyflava4309 - 02.08.2024 14:30

what's the IDE you are using ?

Ответить
@carriewright7247
@carriewright7247 - 30.07.2024 18:37

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.

Ответить
@rohitsharma-xt8qe
@rohitsharma-xt8qe - 28.07.2024 00:14

Hey John, Whats the difference between put and putIfabsent in case a key doesn't exist in a map ?

Ответить
@omerfeyzioglu737
@omerfeyzioglu737 - 19.07.2024 19:52

very quick explanation . can't understand even what you say!

Ответить
@harigs72
@harigs72 - 17.07.2024 19:00

Thankyou ❤🎉

Ответить
@BAZINGA_warrior27
@BAZINGA_warrior27 - 07.07.2024 01:11

hello john. im a day before finals in one of the courses in java that i learn and this video has explaind the hashmap so well. thank you so much

Ответить
@cyrilmartin9221
@cyrilmartin9221 - 03.07.2024 09:39

Concept is crystal clear now. Thank you!!

Ответить
@TanEsal
@TanEsal - 24.06.2024 18:51

It is not the best idea to ise names as keys as hashmap should have unique keys, and names are not unique

Ответить
@Davyyd1
@Davyyd1 - 18.06.2024 20:05

hey someone has a roadmap on this algoritms and in what order should i learn them

Ответить
@blinkestblink
@blinkestblink - 12.06.2024 20:55

You explain so well, thank you

Ответить
@einzelganger5290
@einzelganger5290 - 09.06.2024 02:20

In Python it's called a dictionary (data type "dict") and in JavaScript it's called an object.

Ответить
@FaroukSaniOusmane
@FaroukSaniOusmane - 07.06.2024 12:31

Good

Ответить