For step by step explanation on hashcode and equals() in Java, please check out my new playlist by clicking the link below kzbin.info/aero/PL3NrzZBjk6m95SR6WzhnOGGCjXZpCoO-k
@ChongSLee5 жыл бұрын
i get invalid parameters... is this right url? thanks.
@vimalsubha6 жыл бұрын
I like the way you started the problem and slowly decoding...
@sanketh7682 жыл бұрын
this helped me out with my issue today, thank you ver much
@diavijay08khush944 жыл бұрын
I have become fan of you.... thanks for the informative vedio....and for the people it's not the fake accent ... it's his confidence that he gained due to knowledge....so please don't discourage any knowledgeable person like this...
@manojdehran46986 жыл бұрын
You are a real coder, otherwise most of the people talks about theory. Keep up the good work !!
@coolfreaks685 жыл бұрын
You are what ?
@sreenivasl5383 Жыл бұрын
Explained very nicely.. The way of started, the way of required info from api document, different type objects.. 👏
@swapnilshinde81103 жыл бұрын
it,s Really Helpful me this video..........Thanks a lot Sir.
@muralimohan70973 жыл бұрын
The way you are explaining the concept with example is awesome and it clear to understand
@Karthik-y3o4z5 ай бұрын
You tooooo have an impeccable knowledge😊😊
@madhavanananthan70773 жыл бұрын
Master level explanation, really hats off Actually I watched several videos to understand this concept. But this one is 🔥 simply
@shanthinis5667 Жыл бұрын
Very nice explanation.... Awesome 👍
@prashantthite90612 жыл бұрын
Perfect explanation that I want. Now I am clear with my doubts in hastable. Thanks and please create more video on programming.
@PoonamSharma-gy3ky3 жыл бұрын
Really very helpful content with proper explaination
@AllinOne-et2on3 жыл бұрын
I am watching on Sep 2021. Great job bro. ❤️❤️
@aakashdetwal99503 жыл бұрын
Your way of explain is understandable it is helpful
@niteshpandey8207 Жыл бұрын
That's Amazing I'am not aware about Wrapper class that it having equal and hashcode.
@letusmeet54274 жыл бұрын
so super explanation , really it's wonderful explanation. You borned for us only. so so sooooo nice of you.. Thank you soooooo much.
@mbrajucse3 жыл бұрын
Super bro. Nice explaination.👍
@danceayush81283 жыл бұрын
Now I actually got the point.. Thanks brother 👍
@saranyan39103 жыл бұрын
Wow! Awesome explanation 🙏
@ajaysuresh37813 жыл бұрын
Very nice clear explanation Sir. Thank you 👍
@khagendrakumar80256 жыл бұрын
i saw lots of video but still there is confusion in my mind ,,,after seeing this video i understand 100% of this fundamental,thank u sooooo much,keep going we will support you.
@deepikajagadees79962 жыл бұрын
Thank you a lot for the great explanation
@hetalrachh56654 жыл бұрын
Amazing and very simple explanation, Thanks !!
@OrdinaryTalesofSamriddhi3 жыл бұрын
You describe everything in such an organized and nice manner. No one can compete you. From covering the most trivial detail to covering the complex thing of every concept is what makes you unique. Keep up the good work. Looking forward to many more informative videos from you.
@nareshch64543 жыл бұрын
Wonderful explaination brother
@saiadaikappan4 жыл бұрын
Very clear explanation, thank you !!! your voice makes the explanation more interesting.
@arindamroy76713 жыл бұрын
Not really !
@tasteanotherbite12652 жыл бұрын
Amazing explanation 👌
@harit93804 жыл бұрын
Great Video!! Understood clearly!
@macherladevasundaram49284 жыл бұрын
Very good explanation bro.. Thank you..
@lordgreat60512 жыл бұрын
Because map uses hash to target keys! brilliant example thanks
@ElCanalDelPadrino2 жыл бұрын
Excellent explanation!!
@sangeethchitravel30924 жыл бұрын
Good explanation. Addition to that I wanna add one more point, if u add your custom object as key of map then it should be immutable. So u have to make your employee object as immutable object as string class.
@oussamabr58514 жыл бұрын
Excellent explanation! Thanks.
@somethingforyou8915 жыл бұрын
Superb explanantion. Thank you
@mohanas66976 жыл бұрын
Hi, if possible, please explain why we need to override hashcode() if we are overriding equals()...By the way, your accent doesn't matter only subject matters...Keep it going :-) you are doing a great job...
@vishalgaikwad8736 жыл бұрын
Bcz of contract between .equals()/ hashCode() method. ->Two equivalent object should be placed in same bucket and There HASHCODE must be same. s1.equals(s2); && s1.hashCode()==s2.hashCode();
@coolfreaks685 жыл бұрын
I shall add in a few more points after what Gaikwad said . • Let's consider we have a HashSet which already has 100 elements preloaded in it. • Let's say, we want to add a new element, ie. the 101th element to the set. • The HashSet is designed to keep unique elements only. So when the 101th element is introduced, the add() logic will compare the 101th element, with each of the previously stored 100 elements. Right ? This is where hashcode() comes to rescue. If a proper hashcode() logic has been implemented, then the addition of new elements to the HashSet, will require much fewer equality comparisons. • For example without hashcode() the add() method has to do 100 equality checks. But with a good hascode() logic, the add() operation may not require more that 20 checks.
@srinathravichandran87965 жыл бұрын
@@coolfreaks68 Hi subhadeep..I can get ur point that with a good hashcode logic, we can avoid more comparisons.could you pls explain how it minimizes the comparison?
@coolfreaks685 жыл бұрын
@@srinathravichandran8796 - Obviously because each Hash bucket usually has fewer elements than its parent Hash Set. Only a very bad hascode() logic can push all the elements of HashSet into just one Hash bucket - giving no performance improvement. A good hashcode() logic on the other hand, distributes the elements among multiple buckets, with each bucket having very less number of elements and with all the buckets having almost equal number of elements. Eg : if you have , lets say a 100 element in hash set. A bad hashcode() logic will push all 100 elements into 1 bucket , leaving other buckets empty ! A good hashcode() logic will push 10 elements to each of the 10 buckets. So whenver you are searching , first you find out the bucket number, then you do a binary search inside that specific bucket. So there is performance improvement.
@sergioantoniomartinez92274 жыл бұрын
@@coolfreaks68 that's a clever way of handling buckets, thank you
@kumarvijayag2 жыл бұрын
best example, basic point explained, but still should have talked more about equals and hashcode methods
@salenaluu84773 жыл бұрын
Thank you so much
@atiqulny4 жыл бұрын
You are a genius
@abhinavghosh7254 жыл бұрын
finally someone clearly explained it!
@Ishnavvulu6 жыл бұрын
Thank u sir for the great tutorial.This is fundamental and root to start.This is what we missed till now in other tutorials.very unique explanation.Thank u ..big fan :)
@SeleniumExpress6 жыл бұрын
Thanks, Teju..
@krishnasingh91116 жыл бұрын
Very help full for beginners thank you :)
@kingajable4 жыл бұрын
you doing great job buddy keep it up
@erictang44475 жыл бұрын
Thank you for explanation. The visual animation is very helpful.
@bignormalizedgaps6 жыл бұрын
Спасибо! Thank you from Russia!
@SeleniumExpress6 жыл бұрын
You are welcome !!
@pratikalhat94842 жыл бұрын
very nicely explained
@AtulMishra-rs5os6 жыл бұрын
Explanation was helpful but a bit confusing during few moments. Two advice for you if you accept it.... First: Try to speak in Indian accent of English so it won't fake. Second: Reduce the redundancy of some words you speak very frequently i.e. 'Over here'. You don't complete your most of the sentences without prefixing or suffixing 'Over here' ;). Please don't take it personal and also remember "Your critics are your biggest followers".
@rajeshchouhan4586 жыл бұрын
Agreed men
@SudhanshuSrivastavaIndia5 жыл бұрын
I have same opinion. Sometimes it made me feel annoying. Fantastic tutorial but need to improve the above mentioned points.
@august24outing54 жыл бұрын
Agree, that's the worst part of it...be natural...
@harshav39025 жыл бұрын
Thanks for the explanation dude. It helped.
@anonymouskunal27483 жыл бұрын
overall conclusion 10:40 thank you sir
@kanagarathinamannamalai80205 жыл бұрын
Nice Explanation bro.Thanks👍..
@subhashininallapati20804 жыл бұрын
Excellent teaching. May I know where I can find all your Java interview QA videos, Selenium interview QA , Java tutorial and Selenium tutorial at one place? Could you please share. I am learning a lot from your videos.
@shalabhdixit6 жыл бұрын
No where the difference between hashCode and equals is explained. Also please explain why we need to generate the hashcode and equals method and how did it make the values change from 2 to 1
@SeleniumExpress6 жыл бұрын
Hi Shalabh, This is a video from my interview questions and answers series. So I haven't covered the concept in this video rather this is just an interview question that I am trying to explain. I will be posting a complete video on this concept in the coming week.
@shalabhdixit6 жыл бұрын
@@SeleniumExpress ok. Thank you!
@merajulhaque91074 жыл бұрын
@@SeleniumExpress Can you please share the link for the complete concept video.
@premkirankatinedi44795 жыл бұрын
Wow...this is to the point. Thanks a lot
@techsteering5 жыл бұрын
Excellent. Thanks for sharing your knowledge.
@priyankaraut92894 жыл бұрын
Gud information keep going
@amitaswar70106 жыл бұрын
I like the ending music so much and video too thank you bhai
@sauravsrivastava90192 жыл бұрын
Good explanation
@lux27.425 жыл бұрын
this video easy to understand :) thankyou so much.
@helishah90655 жыл бұрын
Amazing explanation! Thanks a lot :)
@ponsivakumarmanoharan49943 жыл бұрын
Good one
@sulavagarwal35616 жыл бұрын
u got great explanation skills
@dsgtechinfo56393 жыл бұрын
Thanks a lot friend
@shubhamraj51843 жыл бұрын
Wow thanks 💓
@ShubhamGupta-fm7lv6 жыл бұрын
I don't know why I didn't see this video earlier. Got this in an interview and I wasn't able to answer.
@JaspreetSingh-ln1yc4 жыл бұрын
same bro,same!!
@1976balakrishna3 жыл бұрын
nice one
@premkirankatinedi44795 жыл бұрын
Simply Awesome!!
@chloeren91752 жыл бұрын
Thank you so much for your great explanations! so all i need to do is to go to Id=>source=>generate hashcode( )and equal(),so i cn get the map.size(1),right?
@trendytopics-3 жыл бұрын
THANK YOU SO MUCH!
@srilakshmi59225 жыл бұрын
simply awesome
@tw55293 жыл бұрын
Great Explanation👌 Thanks a Lot :-) . BTW, which software are you using for making this video?? It looks so attractive 😊
@srikanth296 жыл бұрын
Thank u very much. Very helpful and clear
@SeleniumExpress6 жыл бұрын
Thanks, Sri Kanth.
@ShadowsOfDave4 жыл бұрын
Nice video Bro
@krishnasuripaka24805 жыл бұрын
Super Brother...
@rthiaga5 жыл бұрын
In the hashCode method why 31 is multiplied by 1 and id. We can directly return the id right?
@raghavanaliassaravananm15465 жыл бұрын
No. That is really required for Hashing, which recommends the key value (here 'id') to be multiplied by a prime number. For all sake of randomness. Most people take 31 as a good prime number to have a better sampling.
@deepar7815 жыл бұрын
Its good. Keep Posting bro
@RiyazParasara5 жыл бұрын
Great thanks.
@felixkimutai84785 жыл бұрын
Great! Thank you.
@alittlecoding5 жыл бұрын
Good job. thanks
@trendingtechnologiesit9246 жыл бұрын
Simply awesome
@gauravsharma8754 жыл бұрын
How come emp1 and emp2 having the same hashcode? Can someone please help
@kssinfonet23943 жыл бұрын
Dear Abhilash sir i have one que. which empoyee object will hashmap put 1st ya 2nd after using hashmap and equal method😊
@ARI-em6me5 жыл бұрын
Very very clear explanation. Plse upload how to upload webproject deployed server
@aayush-zw1mx4 жыл бұрын
But Sir the two employees object hold different memory addresses and in a map we cannot have same keys and in this case the keys emp1 and emp2 are already different only the value they contain are same .So how are the entry set duplicates.Can you pls explain
@rameshbabu57545 жыл бұрын
Below my all question are more help full in interview point of view. So, Could you please explain below all videos to me
@commonman85402 жыл бұрын
HI Avinash, When we use jpa repository.saveOrUpdate(product);, my product object has 1 lak records, will it accept? Is there any limitation ?
@vishnupriya804 жыл бұрын
hi your videos were really helpful. do you have any videos related to regular expressions?
@srinivasang45665 жыл бұрын
Nice
@priyankaraut92894 жыл бұрын
Do videos on java framework
@damodaranm30445 жыл бұрын
Wow r Ally good .and why don't you make videos in following concept cuz there is no good videos in KZbin threads collection jsf spring
@rameshbabu57545 жыл бұрын
Could you please explain the oops (Abstraction, Inheritance, Encapsulation, Polymorphism ) concepts in java with theory and real examples
@rameshbabu57545 жыл бұрын
Could you please explain the Internal mechanism of HashSet in java with theory and real time examples
@nitinpatil11636 жыл бұрын
please explain why we need to override hashcode() if we are overriding equals()
@enessolhan6 жыл бұрын
Listen after 10:15. Integer class has these but Employee class doesn't have it so you need to override them
@coolfreaks685 жыл бұрын
Because the default hashcode() method inherited from Object class won't help in the comparison, if you are using any ready made utility like Collections.sort(), Collection.equals(), new HashSet(Collection) , Map.put() etc. to do the equality checks. All the readymade utilities compare objects based on both hashCode() and equals(). So you need to override both to make it work for you. On the other hand, if you are manually writing the following kind of code : • obj1.equals(obj2) then you dont need to override hashcode(). You can override just the equals() method.
@coolfreaks685 жыл бұрын
But there is an advantage of using hashcode(). Your equality checks work faster, if you use both hashcode() and equals().
@rameshbabu57545 жыл бұрын
Could you please explain the use of Comparable and Comparator in java with theory and real time examples
@dhanalaxmi25695 жыл бұрын
Verify durga software videos it is explained thr
@Ceecee3845 жыл бұрын
When you instantiate 2 Employee objects with the same ID, shouldnt it still be considered as 2 seperate objects? Just because both objects have the same ID value, doesnt mean they are equal? For example, 2 car objects can have the same color attribute. So why would we be expecting the hashmap.size to return 1? It should still have 2 objects mapped, no?
@nishantbansal94094 жыл бұрын
It depends on how your equals method is implemented
@JaishriVemuganti Жыл бұрын
I put the code as you shown in my side and in both cases ham getting size =2
@shubhashree38537 жыл бұрын
Can we avoid duplicate object reference by implementing hascode() n equal () methods?
@uzmaliaquat81645 жыл бұрын
1:52 not static ...instanse variable
@SeleniumExpress5 жыл бұрын
Hi. In 1:52 I said non static variable. We call it instance variable either 🙂