hashcode() in java || The IMPACT of hashcode and equals || java object class || Part 1

แชร์
ฝัง
  • เผยแพร่เมื่อ 2 มี.ค. 2019
  • 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.org/licenses/b...
    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 TH-cam lectures/tutorials/explanations you are by far the most concise, and carefully articulate tutor! thank you

  • @mohamedely3987
    @mohamedely3987 ปีที่แล้ว

    Well-done 🎉

  • @MrPrabhuvin
    @MrPrabhuvin 2 ปีที่แล้ว

    Awesome explain 👍

  • @tirthjayswal9895
    @tirthjayswal9895 2 ปีที่แล้ว

    Very good and deep explenation

  • @vinaymishra8533
    @vinaymishra8533 2 ปีที่แล้ว

    Very good explanations

  • @ravijatwa240
    @ravijatwa240 3 ปีที่แล้ว

    Very good explanation

  • @pushpanjalishivanna5533
    @pushpanjalishivanna5533 5 ปีที่แล้ว +3

    Super:) More n more expectation from you:)

  • @NITISHKUMAR-nx9mk
    @NITISHKUMAR-nx9mk ปีที่แล้ว

    Very Nice Explanation!

  • @Balu-wx7dd
    @Balu-wx7dd 3 ปีที่แล้ว

    Good explanation

  • @bandaruneeraj7246
    @bandaruneeraj7246 9 หลายเดือนก่อน

    Simply Great!!!!!!!

  • @pallavishahare790
    @pallavishahare790 3 ปีที่แล้ว +1

    Very good explanation. Thanks Abhilash.

  • @yatendra__singh
    @yatendra__singh 2 ปีที่แล้ว +2

    Pls create more videos like this ,you are the best on TH-cam for explaining any topic ,pls upload a interview series for experience in Java

  • @zubayerahmedsakib3692
    @zubayerahmedsakib3692 5 ปีที่แล้ว +2

    god bless you brother for this amazing explanataion

  • @a2zs862
    @a2zs862 5 ปีที่แล้ว +1

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

  • @rahimkhan-fh9dd
    @rahimkhan-fh9dd 5 ปีที่แล้ว +1

    nicely explained pls quick upload part 2 of this video

  • @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.

  • @prasantaroutray6053
    @prasantaroutray6053 5 ปีที่แล้ว +1

    Excellent and superb always

  • @jatinlanje5741
    @jatinlanje5741 ปีที่แล้ว

    wow so well explained! Thank you.

  • @Pritamdas-bg7fp
    @Pritamdas-bg7fp 4 ปีที่แล้ว +1

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

  • @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

  • @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.

  • @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.

  • @anilamane6764
    @anilamane6764 5 ปีที่แล้ว

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

  • @soumitanandy5862
    @soumitanandy5862 5 ปีที่แล้ว +2

    Hey, nice lesson..!thank you..

  • @oumaimaabouzaid4948
    @oumaimaabouzaid4948 ปีที่แล้ว

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

  • @unagi4254
    @unagi4254 3 ปีที่แล้ว +2

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

  • @premkirankatinedi4479
    @premkirankatinedi4479 5 ปีที่แล้ว

    WOW MAN! Simply superb...crystal clear

  • @sunilyadav-xt7op
    @sunilyadav-xt7op 5 ปีที่แล้ว +1

    Nice way to make concept clear.... Thnx

  • @TightyWhities94
    @TightyWhities94 5 ปีที่แล้ว +11

    Hey, great lesson! Can you do Serialization sometime?

  • @codewithSuraj7
    @codewithSuraj7 2 หลายเดือนก่อน

    I just want to Say Thank You So much Bro

  • @RanjanSingh-qr1jo
    @RanjanSingh-qr1jo 2 ปีที่แล้ว

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

  • @AbhishekGupta-bt8ib
    @AbhishekGupta-bt8ib 3 ปีที่แล้ว +1

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

  • @shivanideorukhakar
    @shivanideorukhakar 3 ปีที่แล้ว

    super knowledge n best explanation.. thank you

  • @mohammadikram687
    @mohammadikram687 3 ปีที่แล้ว +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.

  • @parambharti7095
    @parambharti7095 3 ปีที่แล้ว +1

    Great !!!!!!

  • @Just_got_it123
    @Just_got_it123 5 ปีที่แล้ว

    great editing work

  • @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.

  • @sukhrobibrokhimov2230
    @sukhrobibrokhimov2230 3 ปีที่แล้ว

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

  • @alvaroisea2259
    @alvaroisea2259 2 ปีที่แล้ว

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

  • @jvsnyc
    @jvsnyc 3 ปีที่แล้ว

    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.

  • @vijayr6540
    @vijayr6540 4 ปีที่แล้ว

    Excellent bhayya , good one Thanks a Lot

  • @nileshmohale2743
    @nileshmohale2743 ปีที่แล้ว

    Very helpful session Thanks 🙏

  • @Dyslexic_Neuron
    @Dyslexic_Neuron 5 ปีที่แล้ว +1

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

  • @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.

  • @willietebs8399
    @willietebs8399 5 ปีที่แล้ว +1

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

  • @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

  • @habeebshaik6207
    @habeebshaik6207 4 ปีที่แล้ว

    Excellent video thanks

  • @chonylau6981
    @chonylau6981 3 ปีที่แล้ว

    Thank you for your crystal clear explanation.

  • @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

  • @cherryartsgallery3177
    @cherryartsgallery3177 3 ปีที่แล้ว

    Very clearer explanation. Keep it up. God bless you

  • @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?

  • @rakeshkumar8908
    @rakeshkumar8908 5 ปีที่แล้ว

    Clear explanation.thnx

  • @sushantsinha2976
    @sushantsinha2976 4 ปีที่แล้ว

    Superb incredible explanation bro.You clear my all doubt

  • @hanisntsolo
    @hanisntsolo 3 ปีที่แล้ว

    Very well explained Thanks a lot.

  • @sathya8242
    @sathya8242 4 หลายเดือนก่อน

    Thanks a ton Abhilash!!

  • @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.

  • @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

  • @vasanth.s1658
    @vasanth.s1658 4 ปีที่แล้ว +1

    Excellent bro!!!..cheerss

  • @koushikdas2755
    @koushikdas2755 4 ปีที่แล้ว

    Very good explanation.

  • @mcq2427
    @mcq2427 5 ปีที่แล้ว

    nicely explained bro, plz upload spring-boot videos

  • @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

  • @prashanthraju7081
    @prashanthraju7081 4 ปีที่แล้ว

    nice explanation

  • @faizulislam5096
    @faizulislam5096 5 ปีที่แล้ว

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

  • @kumarrishav7078
    @kumarrishav7078 4 ปีที่แล้ว

    nice way of explaining...

  • @tech_excellence
    @tech_excellence 4 ปีที่แล้ว

    nice video!

  • @soundaryadash7709
    @soundaryadash7709 2 ปีที่แล้ว

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

  • @user-yg5iw7zk1x
    @user-yg5iw7zk1x 10 วันที่ผ่านมา

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

  • @anshumansahoo5162
    @anshumansahoo5162 5 ปีที่แล้ว +1

    ✌✌

  • @PankajKumar-qk8oh
    @PankajKumar-qk8oh 3 ปีที่แล้ว

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

  • @mutramohanreddy5315
    @mutramohanreddy5315 3 ปีที่แล้ว

    Thank you👍

  • @dilipnathrani8014
    @dilipnathrani8014 5 ปีที่แล้ว +1

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

  • @superflyj416
    @superflyj416 3 ปีที่แล้ว

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

  • @soumyachatterjee745
    @soumyachatterjee745 5 ปีที่แล้ว

    Very very good explanation.

  • @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.

  • @gokuldighe9160
    @gokuldighe9160 4 ปีที่แล้ว

    God bless you

  • @ravitejainapanuri1804
    @ravitejainapanuri1804 2 ปีที่แล้ว

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

  • @hifromspace
    @hifromspace 4 ปีที่แล้ว

    You teach really well

  • @luisv8887
    @luisv8887 2 ปีที่แล้ว

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

  • @shemantsingh765
    @shemantsingh765 2 ปีที่แล้ว

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

  • @suhelbobade3720
    @suhelbobade3720 4 ปีที่แล้ว

    Do u have plan for selenium WebDriver ?

  • @sherlanaveenkumar1837
    @sherlanaveenkumar1837 4 ปีที่แล้ว +1

    Hi, what's the reason for hashcode same for FB, Ea objs, pls share it, yesterday I faced

  • @tindo0038
    @tindo0038 4 ปีที่แล้ว

    thank you so much

  • @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.

  • @naveenvigneshwar5190
    @naveenvigneshwar5190 10 หลายเดือนก่อน

    Thanks a ton :)

  • @DeepakKumar-nr1qj
    @DeepakKumar-nr1qj 4 ปีที่แล้ว

    super

  • @ganeshbejawada2250
    @ganeshbejawada2250 5 ปีที่แล้ว +1

    When will i expect next video of this tutorial Abhilash

  • @sairos4057
    @sairos4057 ปีที่แล้ว

    gigachad!

  • @nagarajanerode
    @nagarajanerode 3 ปีที่แล้ว

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

  • @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.

  • @nithiyaarulanantham4536
    @nithiyaarulanantham4536 5 ปีที่แล้ว +2

    Hey Abilash please upload video on comparator and comparable interface please

  • @saileshyalakaturi366
    @saileshyalakaturi366 5 ปีที่แล้ว +1

    bro please upload spring mvc and spring boot example

  • @start1learn-n171
    @start1learn-n171 ปีที่แล้ว

    Tq

  • @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?

  • @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??

  • @HenryLeu
    @HenryLeu 3 ปีที่แล้ว

    What if 2 objects have the same contents, but their hash codes are different? Are the 2 objects equal or different?

  • @anupamanand1550
    @anupamanand1550 9 หลายเดือนก่อน

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

  • @zamin9438
    @zamin9438 4 ปีที่แล้ว +7

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

  • @joshthompson8478
    @joshthompson8478 4 ปีที่แล้ว

    The traffic though.