02. Equals and HashCode Contract & Different Variations

  Рет қаралды 58,053

Ankit Wasankar

Ankit Wasankar

Күн бұрын

Пікірлер: 72
@KiraTeiubesc
@KiraTeiubesc 3 жыл бұрын
I have watched like 5 videos on this subject, but it still wasn´t that clear. But you explained everything so clearly and easily that now I get it! Thank you very much 🙏 !
@ankit.wasankar
@ankit.wasankar 3 жыл бұрын
Thanks a lot
@rakibullahsarkar1870
@rakibullahsarkar1870 2 жыл бұрын
Exactly!
@Reshmashon
@Reshmashon 22 күн бұрын
Really appreciate your effort to make topics so simple and make sure that we understand it.
@rajatagrawal7016
@rajatagrawal7016 4 ай бұрын
You explained it to me in a very easy manner I have watched many videos but your videos cleared my concepts
@blinkwit1427
@blinkwit1427 3 жыл бұрын
You have a gift for explain clearly concepts. You should continue :)
@ManishKumar-qx1kh
@ManishKumar-qx1kh 3 жыл бұрын
we need to make this channel popular by any means. The videos are exceptionally good. Thanks for the hard work brother.
@rahulrsavant
@rahulrsavant Жыл бұрын
Got 10 out of 10 for Explanation, make lots of different videos, using same style, Thanks 🙏
@ericaugusto5640
@ericaugusto5640 3 жыл бұрын
Amazing teaching skills, thank you for this, now i finally understand this concepts.
@tunghoang9373
@tunghoang9373 3 жыл бұрын
Thanks from a user from Viet Nam Your explanation was so easy to understand although it's hard to understand your english as much :)
@sourabhgurjar1324
@sourabhgurjar1324 3 жыл бұрын
presentation is really good and simple to understand the concept very well.
@karandedhiya9575
@karandedhiya9575 2 жыл бұрын
Very simple and to the point explanation with beautiful PPT
@hassanmahammad1135
@hassanmahammad1135 2 жыл бұрын
Wanted to complete java series, hope u get million subscribers and likes
@priyeshmalviya6483
@priyeshmalviya6483 4 күн бұрын
Thanks bro !! You explained very well about this concept in a video
@sapnahegde5491
@sapnahegde5491 Жыл бұрын
Thanks. Please upload more videos. You make concepts so clear by your explanation.
@ankit.wasankar
@ankit.wasankar Жыл бұрын
thank you, sure uploading more soon.
@naveenprakash3640
@naveenprakash3640 3 жыл бұрын
I usually don't comment....but this is really amazing
@aniruddhachunne3011
@aniruddhachunne3011 2 жыл бұрын
Thank you so much sir... you are saver .....i spend whole day to understand this concept..
@pavankalyanmodugu994
@pavankalyanmodugu994 Жыл бұрын
The way how u explained awesome great sir make more videos in the same style of explanation &presentation also
@shraddhawagh9480
@shraddhawagh9480 2 жыл бұрын
Awesome explanation Sir..... when I watched your videos and went for interviews and explained same which you explained , interviewer really impressed with this ... you deserve million of subscribers Sir... one request can you please make video playlist on one real time project so that it would be beneficial for us ... By using latest technologies like SpringBoot , Microservices, latest angular for frontend Database as oracle DB
@linhpksw
@linhpksw 2 ай бұрын
Very clear and through. Thank you so much. Keep doing more!
@aniketjadhav3503
@aniketjadhav3503 9 ай бұрын
this same interview question is asked to me in datamaticas but could not able to answer but now I can!!
@tanishktripathi217
@tanishktripathi217 2 жыл бұрын
You earned a subscriber, bro! great explanation, keep doing this!
@nikhilbhangale5894
@nikhilbhangale5894 5 ай бұрын
simply great with animation ......
@prashantranjan4859
@prashantranjan4859 2 жыл бұрын
Excellent.. wonderful explanation.. thanks a ton.
@karthikr8798
@karthikr8798 Жыл бұрын
You are a LEGEND sir. Thanks for the video.
@iwn77620
@iwn77620 2 жыл бұрын
Thank you for the effort of visualising it so good. Very clear presentation!
@bharatiyaashish
@bharatiyaashish 3 жыл бұрын
The way you explain is wonderful✨ Please make more vdos...🙏👌👏🌻🇮🇳😊🙇
@supriyashrivastava4535
@supriyashrivastava4535 3 жыл бұрын
Explanation is very precise,clean & well documented. Thank you so much sir. Please make a video on java 8 features with implementation.
@ankit.wasankar
@ankit.wasankar 3 жыл бұрын
Thanks and sure.
@anandlshinde
@anandlshinde 3 жыл бұрын
Good Content / presentation and explaination. Keep it up
@jatinsharma3792
@jatinsharma3792 8 ай бұрын
Ahhhh shukariya bhai !!!
@savaliyaparth468
@savaliyaparth468 Жыл бұрын
Great explanation 👍
@NeverQuitOk
@NeverQuitOk 3 жыл бұрын
KINDLY UPLOAD SOME MORE VIDEOS RELATED TO JAVA INTERVIEW QUESTIONS
@mahmoudramadan9193
@mahmoudramadan9193 7 ай бұрын
Great explanation . thank you ♥
@parleneha25
@parleneha25 3 жыл бұрын
Awsome explanation.. Thank you🙏
@knowledgeispower115
@knowledgeispower115 3 жыл бұрын
Great explanation
@marvellouschandan
@marvellouschandan Жыл бұрын
Awesome explanation bro 😃
@rakibullahsarkar1870
@rakibullahsarkar1870 2 жыл бұрын
Thank you for clearing my confusion
@MHK958
@MHK958 Жыл бұрын
Awsome
@ankit.wasankar
@ankit.wasankar Жыл бұрын
thank you
@sandeep_khangar
@sandeep_khangar 2 жыл бұрын
Awesome video's and pictorial representation ❤️❤️
@RishiChopra141
@RishiChopra141 10 ай бұрын
In Student Class you are not overrriding equals but you are overloading it. To Override equals you have to have same method signature first which is public boolean equals(Object object){...}
@NKG_Creations
@NKG_Creations 3 жыл бұрын
Excellent Sir, Thanks alot
@naveenvigneshwar5190
@naveenvigneshwar5190 Жыл бұрын
Thanks a lot 🙏 💓
@atulverma.515
@atulverma.515 3 жыл бұрын
Thanks, Ankit. this is quite a comprehensive video on this topic. A couple of questions came after using the same example. 1. I have created three objects of the student class, st1, st2, st3. with the same values of roll num and name. put s1, s2, s3, and again s1 in the map. but the size of the map is showing as 3 and not 4. however equals always returning false. 2. how come get() method is working, as equals() method in student class is returning false?
@ankit.wasankar
@ankit.wasankar 3 жыл бұрын
for first question, from java 8 code, i see java people has added an extra check for object equality viz. if (ref1==ref2 || ref1.equals(ref2) ).. so due to this or condition when same object is added it overwrites.. ( thanks for noticing this. will need to update the same in video) for second question, it's really good question and has been answered on stackoverflow. Please check here. stackoverflow.com/questions/13521184/equals-returns-false-yet-object-is-found-in-map/13521238
@atulverma.515
@atulverma.515 3 жыл бұрын
@@ankit.wasankar Thank you Ankit for sparing time to clear my doubt. Cheers.
@priyamore8582
@priyamore8582 2 жыл бұрын
It's just like string. N. When we create with new then instance is thre n alm
@thevagabond85yt
@thevagabond85yt 10 ай бұрын
9:12 this chart is OP
@PriyankaC-wo8ns
@PriyankaC-wo8ns Жыл бұрын
sir, "==" checks if both the objects are pointing to same memory location or not and .equals() method compares the values.
@ankit.wasankar
@ankit.wasankar Жыл бұрын
yes, that is correct, "==" checks if both the references are pointing to same object or not. If equals() method is not overriden, it will use inherited Object.equals() method, which is same as "==" check. If equals() method is override, then it will be behave as per the code in equals() method, and usually equals method is override in such a way that it compares the content/values of object.
@karamjitsinghsehdev3451
@karamjitsinghsehdev3451 Жыл бұрын
But equals method compares the content and not the memory location. 😢
@ankit.wasankar
@ankit.wasankar Жыл бұрын
Yes, the equals() method should always compare the contents. But if you don't override the equals() method in your own class, then it takes the default implementation of the equals() method, and that implementation doesn't compare content instead it compares the memory internally.
@SinghRahul-
@SinghRahul- 2 жыл бұрын
why dont u upload more videos..
@pif5023
@pif5023 8 ай бұрын
I would be careful with the first example, it is confusing. The JVM will say o1.equals(o2) not strictly because they point to the same object in memory but because being the same object their fields will be the same by value. The operator to check for identity (exact same object) is == in Java.
@vijayaakkireddy5952
@vijayaakkireddy5952 3 жыл бұрын
equals() evaluates to the comparison of values in the objects..If so o1.equlas(o3) should return true right.since == is used for memory reference comparision
@ankit.wasankar
@ankit.wasankar 3 жыл бұрын
the default implementation of equals is same as ==
@GauravVermasadh_raj
@GauravVermasadh_raj 3 жыл бұрын
how get operation will work here ?
@sushiljoshi2326
@sushiljoshi2326 2 жыл бұрын
He explained very well with his nicely made presentation ! Thanks for this video. Others make this concept complex, he made it simple .
@AbhishekKumar-pk3zp
@AbhishekKumar-pk3zp Жыл бұрын
For me, this video has the best explanation of hashcode and equals method contract.👍 Worthy to subscribe.
@smsms8522
@smsms8522 3 жыл бұрын
Excellent Video
@sanjayranga2683
@sanjayranga2683 Жыл бұрын
The best explanation ever .. i think my interviewer saw your video :P
@shivaraju8405
@shivaraju8405 3 жыл бұрын
Seriously a wonderful explanation. watched so many videos but after watching this video there is no requirement of watching other videos. Great Work Man, keep it up . tqsm
@sreedharreddy472
@sreedharreddy472 5 ай бұрын
well explained sir. It is very clear.
@mangesh26
@mangesh26 Жыл бұрын
You made my day, I watched dozens of videos and gone through many websites, blogs but not able to get clear understanding. But the way you explained it, it blow my mind. Good Job, keep posting videos
@dnyaneshtathode5511
@dnyaneshtathode5511 2 жыл бұрын
That's a really good explanation. Clear and concise. Keep it up.
@jeebanpradhan8050
@jeebanpradhan8050 Жыл бұрын
Bro logical program java please
@davidbilla2361
@davidbilla2361 2 жыл бұрын
Why you stopped posting videos?
@koenasadhu8068
@koenasadhu8068 2 жыл бұрын
Wonderful explanation!!
@sirojiddinsaidov3657
@sirojiddinsaidov3657 2 жыл бұрын
Very good video. Super
@prasadkondhalkar6499
@prasadkondhalkar6499 Жыл бұрын
Most simplified explanation watched till now. Great work.
03. Exception Handling Basics - You Must Know for Interview
10:35
Ankit Wasankar
Рет қаралды 14 М.
01. Internal Working of HashMap & Java-8 Enhancement
19:11
Ankit Wasankar
Рет қаралды 114 М.
Will A Guitar Boat Hold My Weight?
00:20
MrBeast
Рет қаралды 238 МЛН
escape in roblox in real life
00:13
Kan Andrey
Рет қаралды 85 МЛН
Help Me Celebrate! 😍🙏
00:35
Alan Chikin Chow
Рет қаралды 17 МЛН
08. Static and Default Methods - Java 8 Interview Questions
12:56
Ankit Wasankar
Рет қаралды 6 М.
Being Competent With Coding Is More Fun
11:13
TheVimeagen
Рет қаралды 78 М.
#58 Object Class equals toString hashcode in Java
12:00
Telusko
Рет қаралды 112 М.
06. Difference between Volatile & Synchronized - Java
9:13
Ankit Wasankar
Рет қаралды 8 М.
05. How to create immutable class - Java Interview Questions
9:27
Ankit Wasankar
Рет қаралды 25 М.
Top 25 Microservice Interview Questions Answered - Java Brains
39:54
System Design Interview: TikTok architecture with @sudocode
45:35
Will A Guitar Boat Hold My Weight?
00:20
MrBeast
Рет қаралды 238 МЛН