Java HashMap 🗺️

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

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

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

    import java.util.HashMap;
    public class Main {
    public static void main(String[] args) {
    // HashMap implements the Map interface (need import)
    // HashMap is similar to ArrayList, but with key-value pairs
    // stores objects, need to use Wrapper Class
    // ex: (name,email),(username,userID),(country,capital)

    HashMap countries = new HashMap();

    //add a key and value
    countries.put("USA","Washington DC");
    countries.put("India","New Delhi");
    countries.put("Russia","Moscow");
    countries.put("China","Beijing");

    //System.out.println(countries);
    //countries.remove("USA");
    //System.out.println(countries.get("Russia"));
    //countries.clear();
    //System.out.println(countries.size());
    //countries.replace("USA", "Detroit");
    //System.out.print(countries.containsKey("England"));
    //System.out.print(countries.containsValue("Beijing"));

    for(String i : countries.keySet()) {
    System.out.print(i+"\t"+"= ");
    System.out.println(countries.get(i));
    }

    }
    }

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

      thank you for sharing the code in the comments. saves a lot of pausing and rewinding :)

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

      Bro can you make hash table stuff please..

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

      Instablaster

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

      Yeah you have done correctly no mistake
      Keep it up😊😊😊

    • @salahSaad-ld8id
      @salahSaad-ld8id ปีที่แล้ว

      Thanks for really amazing video it's really helpful

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

    Your short and clear explanations helped me a lot! Thank you

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

    Clear explanation as always bro. Thank you this helped me with my assignment.

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

    Clear, succinct, and complete. Thank you for that.

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

      succ int

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

    Love from Germany

  • @IdoH-vf2yc
    @IdoH-vf2yc ปีที่แล้ว +14

    Hi Bro, hope you're doing well
    Your videos and explanations about Java and many other programming languages you have on the channel are excellent, understandable and very helpful.
    You make a complicated subject much simpler.
    I was wondering if you could add to the playlist, videos that explain the interfaces: List, Set, Map.
    And an explanation of their implementers: HashSet, HashMap, TreeMap, TreeSet, SortedMap, SortedSet, etc.

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

    One thing that always confuse me more is long explanations, I really appreciate how you make this simple and straightforward

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

    very happy to see new java tutorials Bro!

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

      I'll be updating this playlist more often. It seems there's a big demand for Java

    • @user-xe8vl9eh9l
      @user-xe8vl9eh9l 3 ปีที่แล้ว +2

      @@BroCodez theres a big demand for knowledge in the world because most of them cant afford it and want to find free ways to learn .thank you so much for ur videos

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

    When i first heard about Sets and Maps i always thought i'd never use those but they are, in fact, actually easier than actual arrays, i'm kinda mind blown.

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

    That was what I really need to understand! Hashmap in java!

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

    I have been studying Java for 6 months, and my university, as much as the lectures try to help, is absolutely useless, especially for someone like me who suffers from learning disabilities, but your videos are amazing... I wish I found it sooner. They teach me things and help me understand in 1-3 days compared to a month and only half understanding it through my university. Thank you so much! I am been acing my tests with your tutorials xd.

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

    Thank you. Your videos deserve way more atention!

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

    Thanks bro you made learning code fun. ❤
    I don't even have python as a subject but started anyway because I'm having fun

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

    I like your time traveling, :D. Thanks for the videos

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

    Easy and smooth as always
    Thanks a lot bro

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

    Bro is a hero❤❤

  • @sarthakoberoimusic
    @sarthakoberoimusic ปีที่แล้ว +23

    a comment for the sake of defeating the algorithm.

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

    I always learn something new from your videos, thank you!

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

    THANK YOU VERY MUCH. YOUR VIDEOS WERE REALLY USEFUL FOR BEGINNERS LIKE ME. Once again, thanks, Bro.

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

    Every time I watch these videos I am reminded that going to school is overrated … if only my teachers are this clear🤧🤧🤧

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

    Thank you for this video.
    Very clear and straight forward

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

    Great video.

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

    You make coding easy even though I'm mostly learning in theory and writing on pen and paper

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

    Nice video

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

    At 11:11, why does it not list the hashmap in the same order in which it was created? As always, great video. I started at video number 3 and this is number 76. Plan to do them all. Not just watching, but I'm doing them myself. Loving it. Your consistency in how you explain is remarkable.

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

    Great video. Thanks bro

  • @milo-ur8zp
    @milo-ur8zp 4 ปีที่แล้ว +4

    thanks a lot man, crystal clear explanations

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

    So simple 👌

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

    Bravo 👏

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

    Allways perfact explanation❤

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

    wonderfull

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

    Great

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

    Outstanding bro sir

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

    Great Job!

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

    awesome~

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

    Great explanation

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

    Keep it up

  • @Александр-т5з6ы
    @Александр-т5з6ы 2 ปีที่แล้ว

    Nice time-travel 🙂

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

    Nice, bro!

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

    Nice

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

    Good one...simple and easy explanation...thank you bro 🙂

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

    Love From India😁😁😁😁

  • @IDK-kv8ob
    @IDK-kv8ob ปีที่แล้ว

    3:39 the diamond operator at the end of the instantiation does not need to take in the String values. Java infers the type from the first portion! Hey, I actually know something about Java. Feels good.

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

    the best coding youtuber

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

    bro this is awesome wou put things down so concisely

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

    Thank you for all your efforts

  • @eagle1341
    @eagle1341 10 หลายเดือนก่อน +2

    Have you ever eaten grass? Because you are the GOAT! :)

  • @sureshponna3405
    @sureshponna3405 11 หลายเดือนก่อน

    Tqs for cleaning my mind with HashMap doughts😊😊

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

    really easy. thanks for goos explanation.

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

    Thank you so much for the easily understandable explanation!

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

    nice

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

    You're the best Bro

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

    really really nice!

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

    Cheers bro

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

    It's an Arraylist with objects as indecies.

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

    😎💪🏾💪🏾

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

    ❤️From India.

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

    💪

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

    I LOVE THIS!

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

    godly explanation.

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

    me: Searches how to make a hashmap and clicks on a vid
    also me: *INSTANTLY CLICKS ON ANOTHER HASHMAP VID CAUSE ITS BRO CODE*

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

    this was great

  • @РаильРавилов-т9п
    @РаильРавилов-т9п 2 ปีที่แล้ว

    I took tree speps I smashed the butten, subscribed and yes I`d like to become a fello bro ;)

  • @rukiruki-eg4kc
    @rukiruki-eg4kc ปีที่แล้ว

    I too, think about Hashbrowns alot.

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

    Thank you

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

    Thank you bro!!!

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

    OUR BRO CAN TIME TRAVEL!!!

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

    Thanks bro 😊😊

  • @Ahmad-td4ck
    @Ahmad-td4ck 3 ปีที่แล้ว +1

    Thanks bro

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

    Burger -> Patty
    Pizza -> Cheese
    Chapati -> Wheat
    Spring Roll -> BBQ

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

    you make it too easy to understand

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

    love you bro

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

    Thanks bro 😁

  • @MrLoser-ks2xn
    @MrLoser-ks2xn 2 ปีที่แล้ว

    Thanks

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

    you're the bro

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

    Carried me through my comp si exam

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

    Hello is there a playlist for hash map , linked list , stack , Queue ? Thanks for your time.

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

    Thanx

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

    I Helped You.... 😊

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

    Thank You bro

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

    Good thing future bro popped in, I was confused AF and doubting myself.

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

    Thanks bro🙂

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

    Can you do a video about Treemap ?

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

    thanks bro!

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

    could you make course of dsa which you implement code manually

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

    love you

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

    as allWays: Amazing

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

    okay sir

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

    How do you check if a key value pair exists in the hashmap?
    I.e if capital of India is new Delhi?

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

    time to go back to the present

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

    time travelling ,
    Hey guys its bro from the future.

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

    every time you say we should like comment and subscribe to defeat the algorithm im like how do i subscribe again TnT
    bc ive watched like 30 of your videos i can only subscribe once lmao

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

      Raphael Morgan You get a free pass my friend

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

    5:49 This aged well.

  • @kristijanlazarev
    @kristijanlazarev 11 หลายเดือนก่อน

    Very good, could just write everything in a sout statement, so that we dont waste time talking about how it wont do anything unless we pritn

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

    gracias

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

    Ly bro 5

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

    USA goes ROgue!!lol

  • @JohnJohn-sj2ge
    @JohnJohn-sj2ge 2 หลายเดือนก่อน

    Middleweight = Dricus Du Plessis
    Lightweight = Islam Makhachev
    Welterweight = Belal Muhammed
    Featherweight = Ilia Topuria
    ur a legend

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

    Like

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

    varmeste