How to use User defined Object as key in HashMap with an example

  Рет қаралды 33,174

Siva Reddy

Siva Reddy

6 жыл бұрын

Please check out my blog(learnsimple.in) for more technical videos.
For any java/full stack/DevOps/developer/lead positions related mock interviews assistance/Guidance/support, you can reach out me @ sivajavatechie5@gmail.com

Пікірлер: 41
@avinashbhargude8048
@avinashbhargude8048 Жыл бұрын
excellent explanation..useful video
@roshnasuresh1391
@roshnasuresh1391 Жыл бұрын
Clear explanation 🎉
@suryanarayanbisoyi292
@suryanarayanbisoyi292 2 жыл бұрын
Excellent explanation...keep continuing....you dont consider this as source of money income...upload videos in your free time...and make it your passion...you will do wonders
@shreyashachoudhary480
@shreyashachoudhary480 Жыл бұрын
Very clear explanation! Thanks.
@T_tintin
@T_tintin 10 ай бұрын
Can we use arrays as a key for hashmap too?
@sheena936
@sheena936 3 жыл бұрын
Nicely explained!👍🙏
@SivaReddyJavaTechie
@SivaReddyJavaTechie 3 жыл бұрын
Thanks Anurag. Please refer our KZbin channel to your friends and colleagues as it might be helpful for them. Happy learning.
@sheena936
@sheena936 3 жыл бұрын
Already shared. It is really helpful.
@abhinavtiwari5597
@abhinavtiwari5597 6 жыл бұрын
This is nice explanation!!! for immutable key objects
@SivaReddyJavaTechie
@SivaReddyJavaTechie 6 жыл бұрын
Thanks Abhinav. Please refer our channel to your friends circle as it might be helpful for them. Happy Learning.
@chandrachurdafadar6809
@chandrachurdafadar6809 2 жыл бұрын
Just what I needed 🎉🙏
@sameerpatere2983
@sameerpatere2983 6 жыл бұрын
nice explanation sir... thank u so much
@SivaReddyJavaTechie
@SivaReddyJavaTechie 6 жыл бұрын
Thanks Sameer. Please refer our channel to your friends circle as it might helpful for them. Happy learning.
@ramanavanchanagiri1014
@ramanavanchanagiri1014 2 жыл бұрын
Hi Sir your video was good if i want to update the other values empname and usernumber using the emp id is that possible.?
@GuruFoodTravel
@GuruFoodTravel 4 жыл бұрын
Very Nice sir .
@SivaReddyJavaTechie
@SivaReddyJavaTechie 4 жыл бұрын
Thanks Guru. Please refer our KZbin channel to your friends and colleagues as it might be helpful for them. Happy Learning.
@vickkieonline4252
@vickkieonline4252 6 жыл бұрын
Hi Siva, very good explanation ,please provide demo on Junit framework
@SivaReddyJavaTechie
@SivaReddyJavaTechie 6 жыл бұрын
Thanks Vickkie. I will provide demo on Junit ASAP.
@SivaReddyJavaTechie
@SivaReddyJavaTechie 6 жыл бұрын
Junit Tutorial - kzbin.info/www/bejne/lWScf6Zsl9iCmbc
@seemaprajapati964
@seemaprajapati964 4 жыл бұрын
Sir in case we have a null key then how we can reduce it .... If we don't want to store this value ........ !! Map.reduce ()will called or something else pls answer.
@shivamkumar-qs7er
@shivamkumar-qs7er 4 жыл бұрын
Good Explanation.!
@SivaReddyJavaTechie
@SivaReddyJavaTechie 4 жыл бұрын
Thanks Shivam. Please refer our KZbin channel to your friends as it might be helpful for them. Happy Learning.
@DonSPBLegogames
@DonSPBLegogames 3 жыл бұрын
Thank you very much!
@dhanalakshmigurunathan1339
@dhanalakshmigurunathan1339 3 жыл бұрын
good explanation... keep going...
@akashphadtare311
@akashphadtare311 5 жыл бұрын
Very nice..!!
@SivaReddyJavaTechie
@SivaReddyJavaTechie 5 жыл бұрын
Thanks Akash.
@chayanweekend1020
@chayanweekend1020 2 жыл бұрын
Well explained
@Ravikumar-gj6qw
@Ravikumar-gj6qw 6 жыл бұрын
Sir y it is not taking input value of empid in ur pg
@kumarraja1441
@kumarraja1441 5 жыл бұрын
If two unequal objects have same hascode how it will print
@SivaReddyJavaTechie
@SivaReddyJavaTechie 5 жыл бұрын
It will print both unequal objects in the HashMap as it will be stored as LinkedList if more than one object having same hashcode but those are unequal
@vijayvaswani9717
@vijayvaswani9717 5 жыл бұрын
very nice
@SivaReddyJavaTechie
@SivaReddyJavaTechie 5 жыл бұрын
Thanks Vijay. Please refer our KZbin channel to your friends circle as it might be helpful for them. Happy Learning.
@shashanksinghsisodiya514
@shashanksinghsisodiya514 4 жыл бұрын
Mercedes benz i got one question..let we have hashmap with three same key with different value..when normal get() which value will be printed? I told last one will be printed updated one..then he ask if we give user-defined object as a key then which one will be printed..i told result will be the same updated one(third one) will be printed?? In HASHMAP IN THIS CASE key won't override??first key will be printed?? He told my ans is wrong??
@TheKamaltomar
@TheKamaltomar 4 жыл бұрын
If you are using user defined object and you have overridden hashcode and equals , then it will give updates value otherwise it will add all key value pairs.. and without overriding two methods if you use get then first key value pair it will show definitely...
@abdulrawoof5129
@abdulrawoof5129 2 жыл бұрын
How to change key
@suchitvlogTech2130
@suchitvlogTech2130 5 жыл бұрын
How to sort this based on values.???
@SivaReddyJavaTechie
@SivaReddyJavaTechie 5 жыл бұрын
You need implement Comparable or Camparator interface and override compareTo / compare method and use Collections.sort method to sort based on your requirement.
@suchitvlogTech2130
@suchitvlogTech2130 5 жыл бұрын
@@SivaReddyJavaTechie ya sir got. Thanks
@suchitvlogTech2130
@suchitvlogTech2130 5 жыл бұрын
@@SivaReddyJavaTechie sir make a video on this.based on keys and based on values. It will very greatfull.
@for461
@for461 5 жыл бұрын
How to use user defined object as key and value in Hash Map
@TheKamaltomar
@TheKamaltomar 4 жыл бұрын
This video explained the same bro.
How HashMap Works Internally?
20:58
Siva Reddy
Рет қаралды 72 М.
When to use Abstract class and When to use Interface in Java
20:04
Beautiful gymnastics 😍☺️
00:15
Lexa_Merin
Рет қаралды 15 МЛН
Who has won ?? 😀 #shortvideo #lizzyisaeva
00:24
Lizzy Isaeva
Рет қаралды 65 МЛН
Looks realistic #tiktok
00:22
Анастасия Тарасова
Рет қаралды 106 МЛН
Пранк пошел не по плану…🥲
00:59
Саша Квашеная
Рет қаралды 6 МЛН
Remove duplicate user defined objects from HashSet
7:48
Siva Reddy
Рет қаралды 14 М.
HashTable vs HashMap vs Concurrent HashMap all kinds of Map implementations
41:26
Java Interview Q&A on Multi-Threading
34:16
Siva Reddy
Рет қаралды 82 М.
Memory Leaks in Java | Issues Caused and How to Prevent | Example
13:13
equals and hashcode contract in Java
10:51
Siva Reddy
Рет қаралды 12 М.
Garbage collection in Java, with Animation and discussion of G1 GC
44:20
Ranjith ramachandran
Рет қаралды 485 М.
HashMap example  using User Defined Objects
11:13
Siva Reddy
Рет қаралды 53 М.
Beautiful gymnastics 😍☺️
00:15
Lexa_Merin
Рет қаралды 15 МЛН