HashMap Java Tutorial #50

  Рет қаралды 414,337

Alex Lee

Alex Lee

Күн бұрын

Пікірлер: 431
@alexlorenlee
@alexlorenlee Жыл бұрын
If you’re new to programming but want a career in tech, I HIGHLY RECOMMEND applying to one of Springboard’s online coding bootcamps (use code ALEXLEE for $1,000 off): bit.ly/3HX970h
@latedeveloper7836
@latedeveloper7836 3 жыл бұрын
Exemplary tutorial, as always. Timings + my notes below that might help others: 1:45 An example of how hashmaps can help 2:05 Creating and naming a hashmap 2:40 How to add values to a hashmap using the .put method 3:52 Why you should use a generic and data type for type safety when creating a hashmap + how to add this 4:25 Why you need 'Integer' [i.e. class type] for a hashmap (can't take primitive 'int' type) 5:00 Test print of hashmap (default output displays in set notation) 5:30 Calling a specific value from the hashmap - .get call 5:50 Start of more advanced hashmap functions - user + password example 6:15 Creating a hashmap with specific type for type safety 6:33 How to add users and passwords - .put method 7:32 How to remove elements from a hash map - .remove method 8:08 Check if hashmap contains a specific value - .containsValue 8:42 Difference between Values and Keys in a hashmap using .containsValue and .containsKey method calls 9:23 How to replace a value (password) - .replace method 10:10 Key difference between hashmaps and array lists - hashmaps don't have a specific order whereas array lists have an index 11:00 Simple summary of what a hashmap is
@InkMask
@InkMask 2 жыл бұрын
:D
@zorienx
@zorienx 2 жыл бұрын
Thank you for this!
@enochphetteplace8729
@enochphetteplace8729 5 жыл бұрын
This is actually the best description of HashMaps I have seen yet
@josephsanchez2061
@josephsanchez2061 5 жыл бұрын
I don't know if you'll see this since it's an older video but you're probably the only programming tutorial KZbinr that's relatable. The rest of them are super smart and do know what they're talking about (so are you obviously) but for some reason, you admitting that a certain topic or part of a topic confuses you helps me understand the material more when you explain it.
@unitedtomato5444
@unitedtomato5444 3 жыл бұрын
He understands what not knowing something was like. I really appreciate that!
@ulanalibek7225
@ulanalibek7225 5 жыл бұрын
Yes the name itself used to make me think that this HashMap thing is one of the most complicated things in Java. Your tutorial made it look like a piece of cake. :) Thanks! keep up the good work.
@waterflowzz
@waterflowzz 3 жыл бұрын
It’s not complicated to use but the implementation of a hash map is a bit more complex than just a 2d array. Hashmaps use a hash function to store the key value pair so that it doesn’t have to go through the whole hashmap using a for loop, Big O(n), when looking for a key. The hash function lookup makes it so that it is Big O(1). In other words the hash function makes it so that the lookup of a key is faster.
@burakgul2136
@burakgul2136 5 жыл бұрын
This video is awesome. Your english is clear and understandable. I like it 👍
@7own878
@7own878 4 жыл бұрын
Here, after concentrating to get what was said in the Indian accent, one time too often.
@bobbobertson9063
@bobbobertson9063 4 жыл бұрын
@@7own878 it gets tiring to heat the same accent from computer science tutorials all the time
@rxtechandtrading
@rxtechandtrading 2 жыл бұрын
I know...we can actually understand this man, unlike all the other idiots who make tutorials
@anilsuyal
@anilsuyal 4 жыл бұрын
i have watched too many java channels but i found you is the best the best thing about is you is you start to explain a topic in such a way that nothing more required to learn that perticular topic. please bother upload all the java tutorials like spring mvc swings etc.
@baotang5776
@baotang5776 2 жыл бұрын
I wonder how many people, beside me, who graduated IT thanks to you and John. I appreciate you.
@Greenmarty
@Greenmarty Жыл бұрын
2:00 It's called HashMap because it uses hash key to access values in the background and implements Map interface and extends AbstractMap class. If you would write your custom HashMap it would be array of linked lists. Length of the array would not be equal to number of stored key-value pairs. Instead array stores linked list heads, where each list node has hash key, value and points to next node. Hash key is hash version of the key you inserted. To access the value nodes are iterated until hash key matches.
@fakejake8723
@fakejake8723 4 жыл бұрын
Seriously you taught a semestre worth of studies under 20 min. I thank you. I couldn't figure this out until your video. Please make more videos on data structures. I get your explanations.
@luka-j-ovanovic
@luka-j-ovanovic 4 жыл бұрын
For anyone with a python background, hashmaps are the same as dictionaries.
@murkkz1679
@murkkz1679 2 жыл бұрын
Thank you bigman
@MANOJKUMAR-mb2uw
@MANOJKUMAR-mb2uw 2 жыл бұрын
Yes
@nathaniepeter5707
@nathaniepeter5707 2 жыл бұрын
Thank you
@mir.9805
@mir.9805 2 жыл бұрын
Ah the more you know.
@brandonstrobel1365
@brandonstrobel1365 2 жыл бұрын
Saved me 11 minutes !
@darthpepe6761
@darthpepe6761 4 жыл бұрын
I was working on a master order assignment where we had to make a map of cookie variety and its numBoxes sold. This video was very helpful since he basically said, here is the assignment. You're gonna need to know Maps. I appreciate the tutorials. Thank you so much.
@ahmediqbal9869
@ahmediqbal9869 3 жыл бұрын
for anyone that is wondering, it is called a HashMap because it uses a technique called hashing.
@sangeethamnair1395
@sangeethamnair1395 3 жыл бұрын
In a technical aptitude exams hashing question were asked ..had no idea what hashing was and didn't do well but now it is crisp and clear thanks to u Sir..
@Brlitzkreig
@Brlitzkreig 2 жыл бұрын
So glad to see how your channel has grown over time. You really deserve it!
@groupcoop409
@groupcoop409 5 жыл бұрын
Best hashmapping tutorial! super easy to understand well delivered! more tutorials to come THANKS! :D
@gnovakov
@gnovakov 3 жыл бұрын
Love your tutorials, so clear and concise! you just get to the point and it just makes sense!
@mdhossain529
@mdhossain529 4 жыл бұрын
You are great my son. May God Bless you.I am 48 but steel I am your student. Thank you very much.
@chrismissed
@chrismissed 4 жыл бұрын
Dude, thank you so much for this video! I'm 2 years into a computer science degree program and this is the first explanation of a hash map that has made sense to me!
@richardpaynton8766
@richardpaynton8766 2 жыл бұрын
If you are 2 years into a computer science degree and you do not understand the basics of search time algorithms or hashing then either cut your losses and leave or find another service provider
@chrismissed
@chrismissed 2 жыл бұрын
@@richardpaynton8766 I appreciate the advice, but I only have 1 term left now until I graduate. But yes, my teacher was terrible.
@abdullahmamun1823
@abdullahmamun1823 4 жыл бұрын
just as simple as u.thanks.it is a one kind of social work.we need people like u.
@saxkMr
@saxkMr 3 жыл бұрын
now that's amazing how something so abstract to me has become instantly crystal clear. you are awesome!
@MaximumJoy
@MaximumJoy 5 жыл бұрын
This is so helpful. Your explanations and presentation are perfect.
@sunmit_productions
@sunmit_productions 4 жыл бұрын
Thank you very much Alex! I was struggling with HashMap for all day, and your video really helped!!
@shirinall9080
@shirinall9080 3 жыл бұрын
This young dude is my favorite tutor in youtube !!
@miriamarelymartinezcampos238
@miriamarelymartinezcampos238 2 жыл бұрын
I loved the names haha "happy" and "fun", thank you so much for your explanation you made easier to understand
@skat4
@skat4 2 жыл бұрын
Been studying for my Software Engineering Interview, and these videos are so helpful!
@yogeshpandey9549
@yogeshpandey9549 4 жыл бұрын
the most simplified yet extremely informative tut on hashmap. great work m8 :)
@ovey2214
@ovey2214 3 жыл бұрын
Thank you for explaining things so well. You make otherwise complicated things sound so easy to understand. Bless you brother!
@lukedavis6711
@lukedavis6711 4 жыл бұрын
Its called HashMap because it's a data structure that uses the hash function to generate a mapping of keys and their corresponding values.
@richardpaynton8766
@richardpaynton8766 2 жыл бұрын
It was originally used in cryptology as method of assigning a key that is generated using a underlying algorithm and thus this key is then used to place the value into a data structure that can be retrieved. From this it was used because the second and most commonly used reason now is to reduce the search time complexity from O(n), O(n^2) and so on; to O(1). The hash value is the return value of the function that used to generate that hash value and is used as the index positioning of the element and hence used as a key
@hannanhub1717
@hannanhub1717 4 жыл бұрын
thanks a lot i solved the follow program only bcoz of ur help.....FIRST ONE is the one with warning and error code as following......Note: HelloWorld.java uses unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details..........SECOND ONE is correct one... FIRST CODE WITH WARNING import java.util.*; public class HelloWorld { public static void main(String[] args) { HashMap map = new HashMap();/"line with warning"/ map.put("Father", "Rob"); map.put("Mother", "Kirsten"); System.out.println(map.toString()); } } SECOND CODE WITHOUT WARNING(thanks to you) import java.util.*; public class HelloWorld { public static void main(String[] args) { HashMap map = new HashMap();/"this time no warning"/ map.put("Father", "Rob"); map.put("Mother", "Kirsten"); System.out.println(map.toString()); } }
@SquidWRLD
@SquidWRLD Жыл бұрын
thank you for making coding tutorials that arent mind numbing
@h0tar
@h0tar 5 жыл бұрын
That keyboard is amazing! Thanks for clearing up hashmaps for me, makes it easier when we get there at school.
@thischannelisnomore1283
@thischannelisnomore1283 5 жыл бұрын
Most useful on teaching me hashmaps, Thank you so much!
@GuitaristEliKing
@GuitaristEliKing 4 жыл бұрын
Couldnt imagine a better tutorial out there! Great Video man!
@RicardoPires2023
@RicardoPires2023 4 жыл бұрын
Hello Alex and thank you very much for your videos. They are awesome! For this video in particular, it was not clear to me what are the differences of HashMap and ArrayList, and how too choose which to use. Thank you again!
@princeabdul4290
@princeabdul4290 Жыл бұрын
Your Videos are straight to the point , My Coding phobia isn't anymore because of your videos...
@MsVasisth
@MsVasisth 4 жыл бұрын
you don't give weird analogies like other youtube videos good work
@SuhasGowda4695
@SuhasGowda4695 5 жыл бұрын
Thank you for the video. This covers almost everything for novice learners.
@SS-ug1qy
@SS-ug1qy 5 жыл бұрын
My favorite java tutor. if I am not mistaking if u want order you can use TreeMap
@preetamackermann3038
@preetamackermann3038 3 жыл бұрын
You make everything so simple. Thanks a lot !
@mtm6613
@mtm6613 2 жыл бұрын
This was extremely helpful in helping me understand hashmaps. I wasn't understanding them in lectures but this definitely helped clear things up. Thanks!!!
@mugdhashrivastava
@mugdhashrivastava 2 жыл бұрын
love the teachers who make understanding fun. thank you sir
@bieberfever161098
@bieberfever161098 3 жыл бұрын
I finally understood, thanks for the video!! Btw the sound of your keyboard is so satisfying😨
@miledsahar2840
@miledsahar2840 2 жыл бұрын
i don't usually write comments but your tutorials are so good and helpful. keep going !
@antoalex5732
@antoalex5732 4 жыл бұрын
Ivbeen stressing out over this for days cuz of my final. Learned it conpletely under 12 min just now. Just need some practice and the final is gonna be ez. thanks bud!
@kzfingerprint
@kzfingerprint 3 жыл бұрын
Your videos are amazing! Thank you!!! You break down complex things so that I can better understand what's actually going on
@stanshen5207
@stanshen5207 4 жыл бұрын
your voice is so comforting
@Oleks_krulikovskyi
@Oleks_krulikovskyi Жыл бұрын
Thank you ❤
@danishuddin9752
@danishuddin9752 Жыл бұрын
The UI you created it beautiful!
@biscuitbutb4106
@biscuitbutb4106 3 жыл бұрын
These tutorials are awesome. You make java look so easy. Thanks for these easy tutorials!!
@supriyagupta922
@supriyagupta922 3 жыл бұрын
lovely dialogue delivering, excellent quality of video, concepts told in lay man terms. enjoyed and learnt. keep up the good work Alex. :)
@ljka
@ljka 4 жыл бұрын
Just like any other concepts, we learn basic of Java and integrate those knowledges to better understand more complex concepts. HashMap is named as it is because it possesses properties of Map and uses hashing logic in organizing and structuring data. Data Structure ✌🏼 Cool vid
@uzumakinaruto7991
@uzumakinaruto7991 4 жыл бұрын
public class Thank you { public static void main(String args[]) { System.out.println("YOU ARE THE BEST JAVA TEACHER IN THE WORLD"); } }
@johncsanchez9763
@johncsanchez9763 5 жыл бұрын
great tutorial. I understand it alot than my teacher. Thanyou! post more java tutorial
@aishwarya6123
@aishwarya6123 3 жыл бұрын
I definitely recommend Alex's video! Easy to understand and follow!
@helalali9799
@helalali9799 3 жыл бұрын
i am an indian and i actually dont watch englishmen video because i couldnt get the pace of english, but you are the 1st youtuber whose video i watch very confidently. my request is that can you start a series to make people competetive coder from 0 to hero.
@PratyushMishra7
@PratyushMishra7 4 жыл бұрын
instead of typing system.out.println() use sout followed by ctrl+space or cmd+space
@sandianexpress1198
@sandianexpress1198 4 жыл бұрын
or just do sysout followed by ctrl + space.
@nobel978
@nobel978 5 жыл бұрын
Thank you so much, you're an awesome teacher.
@mageshsankaran6521
@mageshsankaran6521 3 жыл бұрын
you explained it effortless
@alexrogers7666
@alexrogers7666 4 жыл бұрын
Thanks for taking time to create content that helps me understand Java! Great job!
@soehtetaung3843
@soehtetaung3843 Жыл бұрын
that's just straight as an arrow. Awesome bro.
@Crimary5580
@Crimary5580 Жыл бұрын
Damn, his Java tutorials are totally understandable, thanks
@rolfchristensen9026
@rolfchristensen9026 2 жыл бұрын
As usual GREAT! Understanding the concept in 11 minutes :)
@aalokitchhabra9031
@aalokitchhabra9031 4 жыл бұрын
Alex you connect really well with your audience. Also about such subjects, I always used to think that i wont understand.. But after watching my first video, the perception has been changed. Please continue making contents. All the best to you. :)
@richardpaynton8766
@richardpaynton8766 2 жыл бұрын
You sound gay do you want to get on your knees for him
@cacmang42
@cacmang42 4 жыл бұрын
you're a great teacher, keep going 💪
@yerffej370
@yerffej370 2 жыл бұрын
Bro why does KZbin keep recommending this. Fine! I’m here. I clicked it
@biggie2123
@biggie2123 3 жыл бұрын
I finally understand HashMaps. Thank you so much!
@STASH01-y2e
@STASH01-y2e 4 жыл бұрын
Legend
@johnvishwas9117
@johnvishwas9117 3 жыл бұрын
You're the best coding tutor!
@KD_Panwar
@KD_Panwar 2 жыл бұрын
pls make a full session on java , your style is best .
@razorlea1
@razorlea1 2 жыл бұрын
You do a great job! Simple and clear! Thank you.
@gary7135
@gary7135 4 жыл бұрын
Gosh I wish I could watch ur vid earlier! I just love the way you teach, clear and understandable. PLZ UPLOAD MORE! LUV YA ♥
@Jigmet8
@Jigmet8 4 жыл бұрын
Hey Alex you're amazing I really love the way you teach...Stay happy 😉
@abhi.marc90
@abhi.marc90 3 жыл бұрын
Wow thank you I was unable to understand hash maps until I stumbled upon your video. Thank you :)
@horrypottur5854
@horrypottur5854 4 жыл бұрын
Extremly good explained! Way better then my proffesor! Sure its not advanced, but i at least undertood the basicis of HashMap. Thank you.
@psalkin
@psalkin 2 жыл бұрын
Best hashmap tutorial ever!
@mzamomahaeng268
@mzamomahaeng268 2 жыл бұрын
You simplified it perfectly.. thank you sir
@eesahash3163
@eesahash3163 4 жыл бұрын
That keyboard giving me the tingles XD
@kakashisenpai99
@kakashisenpai99 2 жыл бұрын
This Channel is underrated
@fridomaraya7438
@fridomaraya7438 3 жыл бұрын
he makes it look and understand so easy.
@victorwolff
@victorwolff 4 жыл бұрын
What type of keyboard is that? The sound is so satisfying XD
@skyeleake9943
@skyeleake9943 3 жыл бұрын
looks like a HHKB TypeS (torpre silent 45g switches)
@heksqer1022
@heksqer1022 5 жыл бұрын
Your videos are very easy to follow !
@geromemanicia3809
@geromemanicia3809 4 жыл бұрын
This was most helpful. I also want one of your keyboards but for now I'm gonna stay with my measly CTRL from drop.
@basithtafadher8743
@basithtafadher8743 4 жыл бұрын
Teaching method really awesome. Wish your good health.
@aidan5320
@aidan5320 3 жыл бұрын
Thank you so much. This helps me assign 1000 "dollars" to each new player. I am making a balance/economy plugin for a minecraft server and this also helps a lot with transactions
@keynoism
@keynoism 4 жыл бұрын
Thank you so much - I've been struggling with this for almost a week unable to get my code to work
@EypsSkWeEm
@EypsSkWeEm 5 жыл бұрын
UNDERSTANDABLE !!! Very good video ! Your explanation is clear and simple ! Good job ! I like it.
@missakhaladjian
@missakhaladjian 4 жыл бұрын
Thank you for these easy-to-understand tutorials, subscribed now!!
@Buddhisteachinggs
@Buddhisteachinggs 5 жыл бұрын
Alex thanks for making HashMap so easy and simple
@alexlorenlee
@alexlorenlee 5 жыл бұрын
Anjali Anirudh you’re welcome!
@chacalangian7054
@chacalangian7054 2 жыл бұрын
pag ganito proctor matuto ka talaga ;)
@mflr121
@mflr121 3 жыл бұрын
Excellent video, I understood everything. Thank you!
@Big-Timbo
@Big-Timbo 4 жыл бұрын
So I'm not entirely sure, as I'm learning CS myself. However, I believe it's called Hashmap, because it seems the main use is for usernames and passwords. a typical way that passwords are stored securely is to create hash values (essentially an encrypted version of that same password) and have those stored in a database instead of the plain text. It would make sense to me that it's called hash map as you're creating a link between what could be used for user's hashed passwords linked to the user account.
@piot99
@piot99 4 жыл бұрын
You're awesome dude! Very nice and concise explanations!
@jeffkamau3432
@jeffkamau3432 4 жыл бұрын
this guy could make a five year old understand hashmaps ! but its really great if you are a beginner!
@anugoudvoddepally348
@anugoudvoddepally348 2 жыл бұрын
really ur explaination was good, after watching video i got clear idea about hash map thank you.
@danielmwinzi9223
@danielmwinzi9223 2 жыл бұрын
You are the best 🙂 simple and clear without complications 👏👏
@adultishgambino8713
@adultishgambino8713 4 жыл бұрын
Such a good tutorial, straightforward and useful
@emerjoerosas2284
@emerjoerosas2284 3 жыл бұрын
this would make implementing my inventory system so simple
@arcane5837
@arcane5837 3 жыл бұрын
Helped out at lot! Very concise!
Simple Java Program In Eclipse - Fart Generator #51
12:50
Alex Lee
Рет қаралды 15 М.
HashSet In Java Tutorial #52
12:20
Alex Lee
Рет қаралды 113 М.
Чистка воды совком от денег
00:32
FD Vasya
Рет қаралды 2,9 МЛН
МЕНЯ УКУСИЛ ПАУК #shorts
00:23
Паша Осадчий
Рет қаралды 5 МЛН
Learn Java in 15 Minutes (seriously)
19:50
ForrestKnight
Рет қаралды 127 М.
Set and HashSet in Java - Full Tutorial
20:43
Coding with John
Рет қаралды 233 М.
31 nooby C++ habits you need to ditch
16:18
mCoding
Рет қаралды 827 М.
NVIDIA’s New AI: Stunning Voice Generator!
6:21
Two Minute Papers
Рет қаралды 84 М.
Generics In Java - Full Simple Tutorial
17:34
Coding with John
Рет қаралды 1,1 МЛН
How HashMap works in Java? With Animation!! whats new in java8 tutorial
15:29
Ranjith ramachandran
Рет қаралды 1 МЛН
Why is Python 150X slower than C?
10:45
Mehul - Codedamn
Рет қаралды 21 М.
Learn Java in 14 Minutes (seriously)
14:00
Alex Lee
Рет қаралды 4,9 МЛН
Hash Tables and Hash Functions
13:56
Computer Science Lessons
Рет қаралды 1,6 МЛН