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)); } } }
@angelcastineira25613 жыл бұрын
thank you for sharing the code in the comments. saves a lot of pausing and rewinding :)
@ikebelida15282 жыл бұрын
Bro can you make hash table stuff please..
@anakinronin52882 жыл бұрын
Instablaster
@mangalmurmu68408 ай бұрын
Yeah you have done correctly no mistake Keep it up😊😊😊
@salahSaad-ld8id3 ай бұрын
Thanks for really amazing video it's really helpful
@kayleighrenner8292 жыл бұрын
Your short and clear explanations helped me a lot! Thank you
@hermitmobile17422 жыл бұрын
Every time I watch these videos I am reminded that going to school is overrated … if only my teachers are this clear🤧🤧🤧
@mctinemacrisp31202 жыл бұрын
Love from Germany
@britneyhanna66673 жыл бұрын
Clear explanation as always bro. Thank you this helped me with my assignment.
@badeaadrian45292 жыл бұрын
Thank you. Your videos deserve way more atention!
@girl69944 жыл бұрын
That was what I really need to understand! Hashmap in java!
@monwil32964 жыл бұрын
So simple 👌
@chetranqui2 жыл бұрын
Clear, succinct, and complete. Thank you for that.
@rene2936 Жыл бұрын
succ int
@desmiles15672 жыл бұрын
Easy and smooth as always Thanks a lot bro
@IdoH-vf2yc Жыл бұрын
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.
@justinbanza47512 жыл бұрын
Thank you for this video. Very clear and straight forward
@lamias77122 жыл бұрын
I like your time traveling, :D. Thanks for the videos
@nkatekongobeni26656 ай бұрын
You make coding easy even though I'm mostly learning in theory and writing on pen and paper
@rimarai789814 күн бұрын
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.
@milo-ur8zp3 жыл бұрын
thanks a lot man, crystal clear explanations
@honkhonkv22362 ай бұрын
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.
@aygula2834 Жыл бұрын
Thank you so much for the easily understandable explanation!
@vpaulino15Ай бұрын
One thing that always confuse me more is long explanations, I really appreciate how you make this simple and straightforward
@chickentendies5144 Жыл бұрын
Good thing future bro popped in, I was confused AF and doubting myself.
@ramie0n Жыл бұрын
Thank you for all your efforts
@youmightdontknow4506 ай бұрын
Allways perfact explanation❤
@FukSN2 жыл бұрын
Back on the Bro vids. Excellent as usual.
@wolanus3 жыл бұрын
Great video. Thanks bro
@polatsaryerli30712 жыл бұрын
bro this is awesome wou put things down so concisely
@sergeyb60714 жыл бұрын
very happy to see new java tutorials Bro!
@BroCodez4 жыл бұрын
I'll be updating this playlist more often. It seems there's a big demand for Java
@user-xe8vl9eh9l3 жыл бұрын
@@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
@neetuseharawat3241 Жыл бұрын
Great explanation
@ramgunta77079 ай бұрын
Good one...simple and easy explanation...thank you bro 🙂
@ksboi293 жыл бұрын
Great video.
@sureshponna34052 ай бұрын
Tqs for cleaning my mind with HashMap doughts😊😊
@kemann38152 жыл бұрын
Bravo 👏
@navidreza492010 ай бұрын
wonderfull
@sagarkathiriya Жыл бұрын
really easy. thanks for goos explanation.
@ardcodelover Жыл бұрын
Outstanding bro sir
@ideaonic7032 жыл бұрын
It's an Arraylist with objects as indecies.
@rukiruki-eg4kc Жыл бұрын
I too, think about Hashbrowns alot.
@greenachos3722 жыл бұрын
Thank you bro!!!
@sarthakoberoimusic10 ай бұрын
a comment for the sake of defeating the algorithm.
@mauxcbr48792 жыл бұрын
Great Job!
@talalbadreddine39782 жыл бұрын
Hello is there a playlist for hash map , linked list , stack , Queue ? Thanks for your time.
@luoluoshomemade71692 жыл бұрын
really really nice!
@hlonimalebana98963 жыл бұрын
How do you check if a key value pair exists in the hashmap? I.e if capital of India is new Delhi?
@nawfalnjm56993 жыл бұрын
Thank you
@Ahmad-td4ck2 жыл бұрын
Thanks bro
@mohtasimhossain3741Ай бұрын
Bro is a hero❤❤
@HolyMolyNEWTonMusicNProgrammer Жыл бұрын
I LOVE THIS!
@arrheniusmbakz61603 ай бұрын
You're the best Bro
@mysterymatt4761 Жыл бұрын
godly explanation.
@CarlAngeloAntenor2 жыл бұрын
me: Searches how to make a hashmap and clicks on a vid also me: *INSTANTLY CLICKS ON ANOTHER HASHMAP VID CAUSE ITS BRO CODE*
@alexshepel55993 жыл бұрын
Nice, bro!
@ibrahimylmaz83782 жыл бұрын
thanks bro
@IDK-kv8ob6 ай бұрын
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.
@MrLoser-ks2xn Жыл бұрын
Thanks
@khantko4670 Жыл бұрын
Thank You bro
@thanhthanhtungnguyen85363 жыл бұрын
Nice video
@rokhafm9412 Жыл бұрын
the best coding youtuber
@mini_dota2 жыл бұрын
Great
@AdrianTregoning2 жыл бұрын
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 Жыл бұрын
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
@diamonddunyasi49457 ай бұрын
Thanks bro🙂
@abisarwan203 жыл бұрын
could you make course of dsa which you implement code manually
@harveers8207 ай бұрын
this was great
@Vinay_Thakur108 Жыл бұрын
❤️From India.
@fl4shgaming188 Жыл бұрын
Burger -> Patty Pizza -> Cheese Chapati -> Wheat Spring Roll -> BBQ
@amankrmj3 жыл бұрын
Love From India😁😁😁😁
@samim2121 Жыл бұрын
Thanx
@mensahtribeadventures26302 жыл бұрын
😎💪🏾💪🏾
@cherolphoshoko86702 жыл бұрын
thanks bro!
@udaysaimanoj2117 Жыл бұрын
Nice
@user-xs6on3cm7o Жыл бұрын
Nice time-travel 🙂
@nages11712 жыл бұрын
Keep it up
@jianlim2762 жыл бұрын
Yea!!
@pedroferreira83284 ай бұрын
💪
@xXMaDGaMeR2 жыл бұрын
love you bro
@khoadiep37742 жыл бұрын
Can you do a video about Treemap ?
@Laughing_india_ Жыл бұрын
you make it too easy to understand
@tasneemayham974 Жыл бұрын
OUR BRO CAN TIME TRAVEL!!!
@user-fi2vc2wt5n Жыл бұрын
I took tree speps I smashed the butten, subscribed and yes I`d like to become a fello bro ;)
@leviplays7466Ай бұрын
you're the bro
@eagle1341Ай бұрын
Have you ever eaten grass? Because you are the GOAT! :)
@amankrmj3 жыл бұрын
I Helped You.... 😊
@timo_b3 Жыл бұрын
brooo why do u use da eclipse, intellij is the alpha bro tool
@benderbg8 ай бұрын
5:49 This aged well.
@kingkock12 жыл бұрын
as allWays: Amazing
@mudzingwajonah73783 жыл бұрын
time travelling , Hey guys its bro from the future.
@arturshakhbanov7608 Жыл бұрын
Like
@kristijanlazarev2 ай бұрын
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
@bharathwajp132127 күн бұрын
Broo what about HashSet???
@manuelgonzalezpalafox2627 Жыл бұрын
Ly bro 5
@damnjemy Жыл бұрын
i need to learn how to combine hashsets and int ch = sc.jscnext()
@raphaelmorgan23073 жыл бұрын
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
@BroCodez3 жыл бұрын
Raphael Morgan You get a free pass my friend
@mathialagant Жыл бұрын
dropping comment
@dev_troy890311 ай бұрын
USA = Washington DC China = Beijing Russia = Moscow India = New Delhi loved having an assignment at the end 😃
@elvastaudinger49913 жыл бұрын
USA goes ROgue!!lol
@mohanedomer908121 күн бұрын
ok
@jeronimo67422 жыл бұрын
commenting, as it is my duty
@paganimarker18984 ай бұрын
what is with the music behind
@swiftyninja35357 ай бұрын
time to go back to the present
@girl69944 жыл бұрын
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.
@BroCodez4 жыл бұрын
I wonder why it's called "red and black tree". That is an interesting translation
@ActualVital4 жыл бұрын
Bro Code I think he wants a video of a Red-Black tree with code.
@girl69944 жыл бұрын
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.
@girl69944 жыл бұрын
Calibre Yes! It is red-black tree. Sorry.
@yamalaha92334 ай бұрын
bro
@LogicalFinds Жыл бұрын
8:50 imagine if the USA’s capita was Detroit 😂
@amaanshaikh6868 Жыл бұрын
😹
@cordellgivens55908 ай бұрын
USA = Detroit China = Beijing India = New Delhi Russia = Moscow