hashcode() in java || The IMPACT of hashcode and equals || java object class || Part 1
Вставка
- Опубліковано 18 вер 2024
- hashcode() in java, overriding hashcode java, how hashcode is calculated in Java,object class in java, what is hashcode in java, hashcode and equals method in java
hashcode java,hashcode and equals in java,object equals method java,important topics in java,hashcode and equals contract in java,java object class methods
java important interview questions,java beginner tutorial,java collection tutorial for beginners
The 'hashcode and equals contract in java’ is one of the most favorite questions in the java interview room. This question is also very important to test candidates
collection fundamental as the hash-based collections like HashSet , hashtable, hashmap etc uses hashcode() and equals() to get its task done. So let’s understand
the hashcode() and equals() from object class(java.lang.object) step by step.
This is part 1 of the ‘hashcode and equals series’ and we will only be talking about hashcode in this video and in the next video we will move to the equals method in java.
This tutorial based on the focus on the following topics.
1 hashcode() description
2 Understanding native åmethod in java
3 Understanding the hashcode calculation
4 Overriding hashcode method of Object class
5 Creating custom hashcode method
6 Key points of hashcode()
For more videos, consider subscribing by clicking the link below.
/ @seleniumexpress
Stay tuned and like my Facebook page for more.
/ seleniumexpress
Music :
-----------
credits : -
(intro)
Adventures by A Himitsu / a-himitsu
Creative Commons - Attribution 3.0 Unported- CC BY 3.0
creativecommons....
Music released by Argofox • A Himitsu - Adventures...
Music provided by Audio Library • Adventures - A Himitsu...
intro template :
/ alexbau01
Of all my years of viewing UA-cam lectures/tutorials/explanations you are by far the most concise, and carefully articulate tutor! thank you
Thank you, Sam.😊
Very good explanation
Very Nice Explanation!
Pls create more videos like this ,you are the best on UA-cam for explaining any topic ,pls upload a interview series for experience in Java
this video helped me A LOT! thank you so much for this tutorial I really appreciate your energy
Good explanation
Simply Great!!!!!!!
wow so well explained! Thank you.
Thank you sooooo much... The explanation is very clear and thorough
Very good explanation. Thanks Abhilash.
truly such a great explanation ...like i am in primary school and the teacher is explaining me
I have been watching a couple of your videos. your knowledge is seriously so deep in coding and you explain truly so basic. I truly thankful for all great knowledge that you share with us and now I am following to watch all your video.
stay bless.
Don't know why this guy has so less subscribers. Definitely he needs more subscribers
Well said
This channel it s in another level .We should pay one .You show how things work internally . Nobody do that. Millon thanks
Excellent and superb always
This is high level explanation ,,,, just no word's to say... This type of professionals required for achieving anything..... You are doing great work... Thank you so much abhilash.... We are expecting more concepts like this from you and help the people like us.... 🙏🙏🙏
Together Moving Forward Team
I love to watch your video and clear my basic fundamental in core java.
Thanks for teaching java this way, the information you're providing is very helpful! thanks!
Great work ! Great teaching ! You put a really great work in this lesson ! If possible make more basic practical examples with trusted libraries. Thank you.
Man o Man ur teaching method is way too good.. Ma Sha Allah nazar na lag jaye kisi ki. Hope ur channel grow fast nd it will.. Keep up the good work sir.
Super:) More n more expectation from you:)
Thank you, you would be a great teacher or programming on IT faculty, very calm, focused and straight to the point. The step by step approach is really effective here. Best wishes.
I just want to Say Thank You So much Bro
Great !!!!!!
Hey, great lesson! Can you do Serialization sometime?
Eagerly waiting for your 3 rd video of the series. Pls complete that. I didn t find any tutorials which gave a satifactory explanation abt the contract bw hascode and equals they are just showing some examples and telling that it is necessary. Pls post a detailed video.
nicely explained pls quick upload part 2 of this video
Well-done 🎉
Thank you bro it was so good tutorial for developers who has not got solid knowledge about hashcode. Respect
Awesome explain 👍
super knowledge n best explanation.. thank you
great explanation. You explain the concept in depth and repeat the concepts again for better understanding just like I do while teaching. Great job. keep it up.
Nice way to make concept clear.... Thnx
Very clearer explanation. Keep it up. God bless you
Simply no words to say than saying Thank You, So Thank you so much Abhilash..Great job keep it up.
Bro, your explanation is very nice. Is it possible to share which books u are following to get this kind of knowledge?
Very good and deep explenation
Very helpful session Thanks 🙏
Excellent video thanks
Thank you for your crystal clear explanation.
Very good explanations
Very well explained Thanks a lot.
god bless you brother for this amazing explanataion
Excellent bhayya , good one Thanks a Lot
Excellent bro!!!..cheerss
Worth every minute ......good amount of hardwork ...thanks
Thank you..Glad that it helped 🙂
this is awesome bro....keep it up....your videos are quite good but you are underrated by youtube....keep up the good work...you are helping million minds like us...god bless you
Very good explanation.
thank you so much
Very detailed and simple explanation, really loved your video :)
Thank you👍
nice explanation
i think your body is filled with java awesome great keep doing such videos love your teaching sir superb
Thanks a ton Abhilash!!
Superb incredible explanation bro.You clear my all doubt
Hey, nice lesson..!thank you..
great editing work
WOW MAN! Simply superb...crystal clear
nice video!
Thanks a ton :)
Bro pls make a set of video of spring aop module.. I saw your whole series of core module and that really attract me the goods of spring framework.. Pls do it for me and rest of the student
✌✌
You teach really well
Good lecture. I was sloppy in one of my previous comments, but I realize we should write hashCode() consistently with the Capital C. Certainly in a tutorial, but really any place. We are used to the IDE fixing things for us, but it is better to remember it correctly.
Good video. Thought he was talking about eunuchs for a second though.
Awesome explanations.... waiting for part 2.... happy coding
wow, the first part was supposed to be boring? it was very interesting! great video
Clear explanation.thnx
Good explanation but very lengthy , could be lot shorter.
Great explanation, really helpful. Please make some java real time projects videos
I think : At 32:11 the hash code method returns same number because u created a string literal, a string object is created by using a new keyword.
Tq
super
Hey Abilash please upload video on comparator and comparable interface please
yes plz do it
nicely explained bro, plz upload spring-boot videos
God bless you
Great video but don't talk extra while making specific ...
Like it
gigachad!
Dear Selenium Express, why is the need to override Hashcode as anyway we are getting hashcode from the default object class ??
Great explaination..Can you please make a video on executor framework.
To make this less confusing, the Strings "FB" and "Ea" were meticulously and purposely chosen, as virtually any other combination of two letters in either String would be different than "2236".
That confused me until I messed around with it myself.
bro please upload spring mvc and spring boot example
I think all string literal point to same heap memory ,while string object points to do different object in heap memory, please let me know if it is otherwise.
@Abhilash, How do I condition the hasCode to generate only 6 numbers per object created?
For selenium automation Engineer up to what level Java is required .
Object identity ensures by equals then why hasch code is required and what is the significance of it?
Such fantastic production quality, but goddammit why does the sound quality always have to be so bad in all these tutorials.
HOW DO YOU KNOW THE HASHCODE FUNC DOES NOT RETURN THE MEMORY ADDRESS OF THE OBJECT IN HEAP!
IS THERE A WAY OF KNOWING THE MEMORY ADDRESS OF OBJECTS IN JAVA
But, as you said, the hashcode is uniquely calculated for an object. Then given the same hashcode, the corresponding objects must be equal, isn't it? Else the implementation of hashcode is incorrect. Can you explain? Do you suggest we must always implement our hashcode for an object where hashing is needed?
I feel like this tutorial could be explained in 10 minutes max. Great Video, but not that concise.
When will i expect next video of this tutorial Abhilash
So in this case, str.equals(str2) will be true, right.. for the values str=FB and str= Ea
Hi..abilash bro...we are eagerly waiting for full spring boot tutorial by selenium express...when it's possible ?
this means equals method is used for content comparison??
great video but next time please edit to bring down the overall video time to max 15-20 mins
what are the befefites of hashcode().
can't we override the hashcode() & equals() method so every time we will get a unique number each time?
If the native Object class implementation of hashcode method utilizes address of the object (which is unique) in the calculation of hashcode, then how is it possible that two different objects (even though they have same contents inside them) can have same hash code? A custom implementation of hash code for Employee class which has integer id as an instance filed might utilize this id to calculate hashcode in which case, different employee objects(E1 and E2) with same id will return same hash code. But if you're relying on object's class hashcode method implementation, how will you get same hash code, when we know E1 and E2 point to two different objects.
Still watching, but halfway thru, I have mixed feelings that you are emphasizing the unique value for each object aspect, when the truly sacred absolute don't-mess-with-this requirement is that two objects which will compare .equals() true must always yield the same hashCode, never different ones. I am sure you get to this, but at halfway point one could have no idea of this yet. EDIT -- 41:30 to 41:50 makes it clear. I hope everyone watched all the way thru. It would also be good to link to Part II in the video description.