Java HashMap 🗺️

Поділитися
Вставка

КОМЕНТАРІ • 152

  • @BroCodez
    @BroCodez  4 роки тому +68

    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 2 роки тому

      Bro can you make hash table stuff please..

    • @anakinronin5288
      @anakinronin5288 2 роки тому

      Instablaster

    • @mangalmurmu6840
      @mangalmurmu6840 10 місяців тому

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

    • @salahSaad-ld8id
      @salahSaad-ld8id 4 місяці тому

      Thanks for really amazing video it's really helpful

  • @kayleighrenner829
    @kayleighrenner829 2 роки тому +10

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

  • @hermitmobile1742
    @hermitmobile1742 2 роки тому +15

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

  • @mctinemacrisp3120
    @mctinemacrisp3120 2 роки тому +2

    Love from Germany

  • @britneyhanna6667
    @britneyhanna6667 3 роки тому +17

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

  • @badeaadrian4529
    @badeaadrian4529 2 роки тому +2

    Thank you. Your videos deserve way more atention!

  • @girl6994
    @girl6994 4 роки тому +3

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

  • @chetranqui
    @chetranqui 2 роки тому +8

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

  • @lamias7712
    @lamias7712 2 роки тому +2

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

  • @IdoH-vf2yc
    @IdoH-vf2yc Рік тому +8

    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.

  • @sarthakoberoimusic
    @sarthakoberoimusic 11 місяців тому +11

    a comment for the sake of defeating the algorithm.

  • @desmiles1567
    @desmiles1567 2 роки тому +4

    Easy and smooth as always
    Thanks a lot bro

  • @justinbanza4751
    @justinbanza4751 2 роки тому +3

    Thank you for this video.
    Very clear and straight forward

  • @nkatekongobeni2665
    @nkatekongobeni2665 7 місяців тому

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

  • @milo-ur8zp
    @milo-ur8zp 3 роки тому +4

    thanks a lot man, crystal clear explanations

  • @FukSN
    @FukSN 2 роки тому +2

    Back on the Bro vids. Excellent as usual.

  • @vpaulino15
    @vpaulino15 3 місяці тому

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

  • @aygula2834
    @aygula2834 Рік тому

    Thank you so much for the easily understandable explanation!

  • @monwil3296
    @monwil3296 4 роки тому +2

    So simple 👌

  • @wolanus
    @wolanus 3 роки тому +2

    Great video. Thanks bro

  • @chickentendies5144
    @chickentendies5144 Рік тому

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

  • @ksboi29
    @ksboi29 3 роки тому +2

    Great video.

  • @youmightdontknow450
    @youmightdontknow450 7 місяців тому

    Allways perfact explanation❤

  • @ideaonic703
    @ideaonic703 2 роки тому +1

    It's an Arraylist with objects as indecies.

  • @polatsaryerli3071
    @polatsaryerli3071 2 роки тому

    bro this is awesome wou put things down so concisely

  • @sergeyb6071
    @sergeyb6071 4 роки тому +7

    very happy to see new java tutorials Bro!

    • @BroCodez
      @BroCodez  4 роки тому +9

      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

  • @mauxcbr4879
    @mauxcbr4879 3 роки тому +2

    Great Job!

  • @sureshponna3405
    @sureshponna3405 3 місяці тому

    Tqs for cleaning my mind with HashMap doughts😊😊

  • @honkhonkv2236
    @honkhonkv2236 3 місяці тому

    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.

  • @ramie0n
    @ramie0n Рік тому

    Thank you for all your efforts

  • @luoluoshomemade7169
    @luoluoshomemade7169 2 роки тому +1

    really really nice!

  • @ramgunta7707
    @ramgunta7707 11 місяців тому

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

  • @rukiruki-eg4kc
    @rukiruki-eg4kc Рік тому

    I too, think about Hashbrowns alot.

  • @sagarkathiriya
    @sagarkathiriya Рік тому

    really easy. thanks for goos explanation.

  • @neetuseharawat3241
    @neetuseharawat3241 Рік тому

    Great explanation

  • @rimarai7898
    @rimarai7898 Місяць тому

    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.

  • @ardcodelover
    @ardcodelover Рік тому

    Outstanding bro sir

  • @greenachos372
    @greenachos372 2 роки тому +2

    Thank you bro!!!

  • @talalbadreddine3978
    @talalbadreddine3978 2 роки тому +2

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

  • @alexshepel5599
    @alexshepel5599 3 роки тому +2

    Nice, bro!

  • @mysterymatt4761
    @mysterymatt4761 2 роки тому

    godly explanation.

  • @kemann3815
    @kemann3815 2 роки тому +1

    Bravo 👏

  • @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.

    • @TheRealZitroX
      @TheRealZitroX Рік тому +1

      A hashmap is not a list where you push elements at the end. Watch a video of a implementation of this method so you know more about it

  • @abisarwan20
    @abisarwan20 3 роки тому +1

    could you make course of dsa which you implement code manually

  • @CarlAngeloAntenor
    @CarlAngeloAntenor 2 роки тому +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*

  • @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?

  • @nawfalnjm5699
    @nawfalnjm5699 3 роки тому +2

    Thank you

  • @HolyMolyNEWTonMusicNProgrammer

    I LOVE THIS!

  • @navidreza4920
    @navidreza4920 Рік тому

    wonderfull

  • @khoadiep3774
    @khoadiep3774 2 роки тому

    Can you do a video about Treemap ?

  • @user-xs6on3cm7o
    @user-xs6on3cm7o Рік тому

    Nice time-travel 🙂

  • @Ahmad-td4ck
    @Ahmad-td4ck 3 роки тому +1

    Thanks bro

  • @amankrmj
    @amankrmj 3 роки тому +2

    Love From India😁😁😁😁

  • @thanhthanhtungnguyen8536
    @thanhthanhtungnguyen8536 3 роки тому +1

    Nice video

  • @harveers820
    @harveers820 8 місяців тому

    this was great

  • @arrheniusmbakz6160
    @arrheniusmbakz6160 5 місяців тому

    You're the best Bro

  • @nages1171
    @nages1171 2 роки тому +2

    Keep it up

  • @IDK-kv8ob
    @IDK-kv8ob 8 місяців тому

    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.

  • @cherolphoshoko8670
    @cherolphoshoko8670 2 роки тому +1

    thanks bro!

  • @mohtasimhossain3741
    @mohtasimhossain3741 3 місяці тому +1

    Bro is a hero❤❤

  • @tasneemayham974
    @tasneemayham974 Рік тому

    OUR BRO CAN TIME TRAVEL!!!

  • @khantko4670
    @khantko4670 Рік тому

    Thank You bro

  • @Dhruv_rathee_AAP_ITCell
    @Dhruv_rathee_AAP_ITCell Рік тому

    ❤️From India.

  • @mini_dota
    @mini_dota 2 роки тому

    Great

  • @MrLoser-ks2xn
    @MrLoser-ks2xn Рік тому

    Thanks

  • @xXMaDGaMeR
    @xXMaDGaMeR 2 роки тому

    love you bro

  • @diamonddunyasi4945
    @diamonddunyasi4945 8 місяців тому

    Thanks bro🙂

  • @ibrahimylmaz8378
    @ibrahimylmaz8378 2 роки тому

    thanks bro

  • @user-fi2vc2wt5n
    @user-fi2vc2wt5n 2 роки тому

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

  • @eagle1341
    @eagle1341 3 місяці тому +1

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

  • @samim2121
    @samim2121 Рік тому

    Thanx

  • @amankrmj
    @amankrmj 3 роки тому

    I Helped You.... 😊

  • @percivalgebashe4376
    @percivalgebashe4376 Рік тому

    Nice

  • @Laughing_india_
    @Laughing_india_ 2 роки тому

    you make it too easy to understand

  • @fl4shgaming188
    @fl4shgaming188 Рік тому +1

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

  • @leviplays7466
    @leviplays7466 2 місяці тому

    you're the bro

  • @rokhafm9412
    @rokhafm9412 Рік тому

    the best coding youtuber

  • @kingkock1
    @kingkock1 2 роки тому

    as allWays: Amazing

  • @mensahtribeadventures2630
    @mensahtribeadventures2630 2 роки тому

    😎💪🏾💪🏾

  • @pedroferreira8328
    @pedroferreira8328 6 місяців тому

    💪

  • @mudzingwajonah7378
    @mudzingwajonah7378 3 роки тому +1

    time travelling ,
    Hey guys its bro from the future.

  • @eugenezuev7349
    @eugenezuev7349 24 дні тому

    gracias

  • @kristijanlazarev
    @kristijanlazarev 4 місяці тому

    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

  • @bharathwajp1321
    @bharathwajp1321 2 місяці тому

    Broo what about HashSet???

  • @timo_b3
    @timo_b3 2 роки тому

    brooo why do u use da eclipse, intellij is the alpha bro tool

  • @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

  • @elvastaudinger4991
    @elvastaudinger4991 3 роки тому +1

    USA goes ROgue!!lol

  • @damnjemy
    @damnjemy Рік тому

    i need to learn how to combine hashsets and int ch = sc.jscnext()

  • @benderbg
    @benderbg 9 місяців тому

    5:49 This aged well.

  • @paganimarker1898
    @paganimarker1898 6 місяців тому

    what is with the music behind

  • @manuelgonzalezpalafox2627
    @manuelgonzalezpalafox2627 Рік тому

    Ly bro 5

  • @arturshakhbanov7608
    @arturshakhbanov7608 Рік тому

    Like

  • @mathialagant
    @mathialagant Рік тому

    dropping comment

  • @girl6994
    @girl6994 4 роки тому +1

    There are too many things need to understand, such as collections , list, especially Linkedlist, it is abstract. And tree map. I don’t understand what is tree map. In Chinese they say a word 红黑树 , which means red and black tree style to store hash code.

    • @BroCodez
      @BroCodez  4 роки тому +2

      I wonder why it's called "red and black tree". That is an interesting translation

    • @ActualVital
      @ActualVital 4 роки тому

      Bro Code I think he wants a video of a Red-Black tree with code.

    • @girl6994
      @girl6994 4 роки тому

      Bro Code because if you use different color to mark a tree map, it will be more easy to find a certain hash code I think. For example base level is black, and second level is red, and third level is black. But I am also don’t know, why it is called black and red tree.

    • @girl6994
      @girl6994 4 роки тому

      Calibre Yes! It is red-black tree. Sorry.

  • @mohanedomer9081
    @mohanedomer9081 2 місяці тому

    ok

  • @dev_troy8903
    @dev_troy8903 Рік тому

    USA = Washington DC
    China = Beijing
    Russia = Moscow
    India = New Delhi
    loved having an assignment at the end 😃

  • @LogicalFinds
    @LogicalFinds Рік тому

    8:50 imagine if the USA’s capita was Detroit 😂

  • @swiftyninja3535
    @swiftyninja3535 8 місяців тому

    time to go back to the present

  • @jeronimo6742
    @jeronimo6742 2 роки тому

    commenting, as it is my duty

  • @exitspree
    @exitspree 4 місяці тому

    down below