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

КОМЕНТАРІ • 140

  • @lsamparkl
    @lsamparkl 4 роки тому +25

    Of all my years of viewing UA-cam lectures/tutorials/explanations you are by far the most concise, and carefully articulate tutor! thank you

  • @ravijatwa240
    @ravijatwa240 3 роки тому

    Very good explanation

  • @NITISHKUMAR-nx9mk
    @NITISHKUMAR-nx9mk 2 роки тому

    Very Nice Explanation!

  • @yatendra__singh
    @yatendra__singh 3 роки тому +2

    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

  • @unagi4254
    @unagi4254 3 роки тому +2

    this video helped me A LOT! thank you so much for this tutorial I really appreciate your energy

  • @Balu-wx7dd
    @Balu-wx7dd 3 роки тому

    Good explanation

  • @bandaruneeraj7246
    @bandaruneeraj7246 11 місяців тому

    Simply Great!!!!!!!

  • @jatinlanje5741
    @jatinlanje5741 Рік тому

    wow so well explained! Thank you.

  • @oumaimaabouzaid4948
    @oumaimaabouzaid4948 Рік тому

    Thank you sooooo much... The explanation is very clear and thorough

  • @pallavishahare790
    @pallavishahare790 3 роки тому +1

    Very good explanation. Thanks Abhilash.

  • @Pritamdas-bg7fp
    @Pritamdas-bg7fp 4 роки тому +1

    truly such a great explanation ...like i am in primary school and the teacher is explaining me

  • @nebilgokdemir4527
    @nebilgokdemir4527 4 роки тому +1

    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.

  • @AbhishekGupta-bt8ib
    @AbhishekGupta-bt8ib 3 роки тому +1

    Don't know why this guy has so less subscribers. Definitely he needs more subscribers

  • @alxx736
    @alxx736 3 роки тому

    This channel it s in another level .We should pay one .You show how things work internally . Nobody do that. Millon thanks

  • @prasantaroutray6053
    @prasantaroutray6053 5 років тому +1

    Excellent and superb always

  • @gugudukullaiswamy1815
    @gugudukullaiswamy1815 5 років тому +5

    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.... 🙏🙏🙏

  • @mohdshazalibinhamid9374
    @mohdshazalibinhamid9374 2 роки тому

    Together Moving Forward Team

  • @RanjanSingh-qr1jo
    @RanjanSingh-qr1jo 3 роки тому

    I love to watch your video and clear my basic fundamental in core java.

  • @alvaroisea2259
    @alvaroisea2259 2 роки тому

    Thanks for teaching java this way, the information you're providing is very helpful! thanks!

  • @vladanulardzic5859
    @vladanulardzic5859 4 роки тому +2

    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.

  • @mohammadikram687
    @mohammadikram687 4 роки тому +1

    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.

  • @pushpanjalishivanna5533
    @pushpanjalishivanna5533 5 років тому +3

    Super:) More n more expectation from you:)

  • @stevancosovic4706
    @stevancosovic4706 3 роки тому

    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.

  • @codewithSuraj7
    @codewithSuraj7 4 місяці тому

    I just want to Say Thank You So much Bro

  • @parambharti7095
    @parambharti7095 3 роки тому +1

    Great !!!!!!

  • @TightyWhities94
    @TightyWhities94 5 років тому +11

    Hey, great lesson! Can you do Serialization sometime?

  • @arpanbanerjee8584
    @arpanbanerjee8584 4 роки тому +1

    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.

  • @rahimkhan-fh9dd
    @rahimkhan-fh9dd 5 років тому +1

    nicely explained pls quick upload part 2 of this video

  • @mohamedely3987
    @mohamedely3987 Рік тому

    Well-done 🎉

  • @sukhrobibrokhimov2230
    @sukhrobibrokhimov2230 3 роки тому

    Thank you bro it was so good tutorial for developers who has not got solid knowledge about hashcode. Respect

  • @MrPrabhuvin
    @MrPrabhuvin 2 роки тому

    Awesome explain 👍

  • @shivanideorukhakar
    @shivanideorukhakar 4 роки тому

    super knowledge n best explanation.. thank you

  • @bloom6874
    @bloom6874 2 роки тому

    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.

  • @sunilyadav-xt7op
    @sunilyadav-xt7op 5 років тому +1

    Nice way to make concept clear.... Thnx

  • @cherryartsgallery3177
    @cherryartsgallery3177 3 роки тому

    Very clearer explanation. Keep it up. God bless you

  • @a2zs862
    @a2zs862 5 років тому +1

    Simply no words to say than saying Thank You, So Thank you so much Abhilash..Great job keep it up.

  • @JavaObjectException
    @JavaObjectException 3 роки тому +2

    Bro, your explanation is very nice. Is it possible to share which books u are following to get this kind of knowledge?

  • @tirthjayswal9895
    @tirthjayswal9895 2 роки тому

    Very good and deep explenation

  • @nileshmohale2743
    @nileshmohale2743 Рік тому

    Very helpful session Thanks 🙏

  • @habeebshaik6207
    @habeebshaik6207 4 роки тому

    Excellent video thanks

  • @chonylau6981
    @chonylau6981 3 роки тому

    Thank you for your crystal clear explanation.

  • @vinaymishra8533
    @vinaymishra8533 2 роки тому

    Very good explanations

  • @hanisntsolo
    @hanisntsolo 3 роки тому

    Very well explained Thanks a lot.

  • @zubayerahmedsakib3692
    @zubayerahmedsakib3692 5 років тому +2

    god bless you brother for this amazing explanataion

  • @vijayr6540
    @vijayr6540 4 роки тому

    Excellent bhayya , good one Thanks a Lot

  • @vasanth.s1658
    @vasanth.s1658 4 роки тому +1

    Excellent bro!!!..cheerss

  • @Dyslexic_Neuron
    @Dyslexic_Neuron 5 років тому +1

    Worth every minute ......good amount of hardwork ...thanks

  • @thatpanditcoder
    @thatpanditcoder 4 роки тому

    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

  • @koushikdas2755
    @koushikdas2755 4 роки тому

    Very good explanation.

  • @tindo0038
    @tindo0038 4 роки тому

    thank you so much

  • @soundaryadash7709
    @soundaryadash7709 2 роки тому

    Very detailed and simple explanation, really loved your video :)

  • @mutramohanreddy5315
    @mutramohanreddy5315 3 роки тому

    Thank you👍

  • @prashanthraju7081
    @prashanthraju7081 4 роки тому

    nice explanation

  • @anilamane6764
    @anilamane6764 5 років тому

    i think your body is filled with java awesome great keep doing such videos love your teaching sir superb

  • @sathya8242
    @sathya8242 6 місяців тому

    Thanks a ton Abhilash!!

  • @sushantsinha2976
    @sushantsinha2976 5 років тому

    Superb incredible explanation bro.You clear my all doubt

  • @soumitanandy5862
    @soumitanandy5862 5 років тому +2

    Hey, nice lesson..!thank you..

  • @Just_got_it123
    @Just_got_it123 5 років тому

    great editing work

  • @premkirankatinedi4479
    @premkirankatinedi4479 5 років тому

    WOW MAN! Simply superb...crystal clear

  • @tech_excellence
    @tech_excellence 5 років тому

    nice video!

  • @naveenvigneshwar5190
    @naveenvigneshwar5190 Рік тому

    Thanks a ton :)

  • @abdullahbinmazi7137
    @abdullahbinmazi7137 5 років тому +1

    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

  • @anshumansahoo5162
    @anshumansahoo5162 5 років тому +1

    ✌✌

  • @hifromspace
    @hifromspace 4 роки тому

    You teach really well

  • @jvsnyc
    @jvsnyc 4 роки тому

    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.

  • @superflyj416
    @superflyj416 3 роки тому

    Good video. Thought he was talking about eunuchs for a second though.

  • @dilipnathrani8014
    @dilipnathrani8014 5 років тому +1

    Awesome explanations.... waiting for part 2.... happy coding

  • @luisv8887
    @luisv8887 2 роки тому

    wow, the first part was supposed to be boring? it was very interesting! great video

  • @rakeshkumar8908
    @rakeshkumar8908 5 років тому

    Clear explanation.thnx

  • @SurendraGurjar2014
    @SurendraGurjar2014 3 роки тому

    Good explanation but very lengthy , could be lot shorter.

  • @PankajKumar-qk8oh
    @PankajKumar-qk8oh 4 роки тому

    Great explanation, really helpful. Please make some java real time projects videos

  • @davidfabian8620
    @davidfabian8620 3 роки тому

    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.

  • @start1learn-n171
    @start1learn-n171 Рік тому

    Tq

  • @DeepakKumar-nr1qj
    @DeepakKumar-nr1qj 4 роки тому

    super

  • @nithiyaarulanantham4536
    @nithiyaarulanantham4536 5 років тому +2

    Hey Abilash please upload video on comparator and comparable interface please

  • @mcq2427
    @mcq2427 5 років тому

    nicely explained bro, plz upload spring-boot videos

  • @gokuldighe9160
    @gokuldighe9160 5 років тому

    God bless you

  • @Bhavdip2011
    @Bhavdip2011 3 роки тому

    Great video but don't talk extra while making specific ...
    Like it

  • @sairos4057
    @sairos4057 Рік тому

    gigachad!

  • @shemantsingh765
    @shemantsingh765 2 роки тому

    Dear Selenium Express, why is the need to override Hashcode as anyway we are getting hashcode from the default object class ??

  • @faizulislam5096
    @faizulislam5096 5 років тому

    Great explaination..Can you please make a video on executor framework.

  • @mattsmith6828
    @mattsmith6828 3 роки тому

    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.

  • @saileshyalakaturi366
    @saileshyalakaturi366 5 років тому +1

    bro please upload spring mvc and spring boot example

  • @vigneshdeven3177
    @vigneshdeven3177 4 роки тому

    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.

  • @willietebs8399
    @willietebs8399 5 років тому +1

    @Abhilash, How do I condition the hasCode to generate only 6 numbers per object created?

  • @user-yg5iw7zk1x
    @user-yg5iw7zk1x 2 місяці тому

    For selenium automation Engineer up to what level Java is required .

  • @ravitejainapanuri1804
    @ravitejainapanuri1804 2 роки тому

    Object identity ensures by equals then why hasch code is required and what is the significance of it?

  • @BlueHawkPictures17
    @BlueHawkPictures17 4 роки тому

    Such fantastic production quality, but goddammit why does the sound quality always have to be so bad in all these tutorials.

  • @abhinavghosh725
    @abhinavghosh725 4 роки тому +2

    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

  • @dipak002
    @dipak002 3 роки тому

    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?

  • @zamin9438
    @zamin9438 5 років тому +7

    I feel like this tutorial could be explained in 10 minutes max. Great Video, but not that concise.

  • @ganeshbejawada2250
    @ganeshbejawada2250 5 років тому +1

    When will i expect next video of this tutorial Abhilash

  • @nagarajanerode
    @nagarajanerode 3 роки тому

    So in this case, str.equals(str2) will be true, right.. for the values str=FB and str= Ea

  • @Rk_---_M-i3p
    @Rk_---_M-i3p 4 роки тому

    Hi..abilash bro...we are eagerly waiting for full spring boot tutorial by selenium express...when it's possible ?

  • @aastha4708
    @aastha4708 3 роки тому

    this means equals method is used for content comparison??

  • @rgrm104
    @rgrm104 4 роки тому

    great video but next time please edit to bring down the overall video time to max 15-20 mins

  • @sandeepkumarnayak4865
    @sandeepkumarnayak4865 4 роки тому

    what are the befefites of hashcode().

  • @anupamanand1550
    @anupamanand1550 11 місяців тому

    can't we override the hashcode() & equals() method so every time we will get a unique number each time?

  • @pragun1993
    @pragun1993 4 роки тому

    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.

  • @jvsnyc
    @jvsnyc 4 роки тому

    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.