Equals and hashcode in Java Part 1 - How they impact Collections - IMPORTANT | Java9s

  Рет қаралды 223,961

java9s

java9s

Күн бұрын

Пікірлер: 42
@mistery4437
@mistery4437 8 жыл бұрын
శ్రీనివాస్ గారు, equals, hashCode మధ్య తేడాని బాగా వివరించారు. థ్యాంక్యూ ! Credit is where credit due.
@java9s
@java9s 8 жыл бұрын
+Common Yunus thank you. Happy to see your comment
@Adam-gp3ij
@Adam-gp3ij 5 жыл бұрын
Sir, this is insane ! thank you so much ! we pay a lot of Money without a 1% of these explanations in the university ! thank you again
@niebboycyrax
@niebboycyrax 6 жыл бұрын
Really helpful, thank you sir.
@AihQuresh
@AihQuresh 8 жыл бұрын
Great explanation!
@kumarshivam760
@kumarshivam760 5 жыл бұрын
Very informative video. Please make a video on hashcode implementation and ovveriding also.
@text2564
@text2564 8 жыл бұрын
Very informative. Thanks
@poornas9520
@poornas9520 6 жыл бұрын
great video but why do you hit your keyboard so hard?
@sowmithgantla8674
@sowmithgantla8674 7 жыл бұрын
wonderful explanation.
@naveenp4890
@naveenp4890 7 жыл бұрын
Simple and Lucid explanation. Respects!
@parthdalvi5855
@parthdalvi5855 6 жыл бұрын
Nice Explanation !! :-) Thanks !! :-)
@DeepakKumar-zk3dc
@DeepakKumar-zk3dc 2 жыл бұрын
As I know equals() method is used for content comparison while == is used to compare object address. That's why s.equals(s2) will generate true rather than false because content is same
@DR-pi9vk
@DR-pi9vk 5 жыл бұрын
it will return true when you compare these objects: Student s and Student s2 with equals, because they have the same object argument
@jyotipalapure4623
@jyotipalapure4623 6 жыл бұрын
s.equals(s2) method will return true, not false.
@MuthuKumar-qi2um
@MuthuKumar-qi2um 8 жыл бұрын
good explanation
@dips2805
@dips2805 7 жыл бұрын
excellent explanation... please make a video on how to authenticate rest web services using OAuth and OAuth 2.
@2010lakshitha
@2010lakshitha 4 жыл бұрын
thank you!!!
@dhiru7853
@dhiru7853 7 жыл бұрын
i have equals and hashcode methods when am tryin to give same values to 2 different objects and trying to do this obj1==obj2 its giving false but its giving true for (obj1.equals(obj2)) what should i do to get true for obj1==obj2????
@sunilmaurya9086
@sunilmaurya9086 6 жыл бұрын
dhi ru == compares memory location just see if hashcode is correct
@MrJonnis13
@MrJonnis13 8 жыл бұрын
Is it true that hashcode returns the memory location of the object, converted to an integer ? OR it returns something irrelevant of the memory location ?
@java9s
@java9s 8 жыл бұрын
+Yiannis Ioannidis true.. Check the object class documentation here docs.oracle.com/javase/7/docs/api/java/lang/Object.html
@MrJonnis13
@MrJonnis13 8 жыл бұрын
+java9s Thanks a lot for this, and for your effort making these videos in general !
@PawanKumar-lf2cb
@PawanKumar-lf2cb 8 жыл бұрын
class Equls { public static void main(String[] args) { String s1 = new String("hell55o"); String s2 = new String("hell55o"); System.out.println(s1.equals(s2)); } } i am confused :\ ? becons ans is true you are telling false :(
@pjain7190
@pjain7190 8 жыл бұрын
Because String is predefined class having implemented Equals and HashCode function it.
@DilipSirClass
@DilipSirClass 8 жыл бұрын
Yiannis Ioannidis in java there is no way to find out address.
@krayziesensei
@krayziesensei 6 жыл бұрын
Excellent explanation. Thank you, sir.
@manideepreddygeetla3078
@manideepreddygeetla3078 4 жыл бұрын
What you said at 3.07 sec is false ,it returns true
@djanupamdas
@djanupamdas 6 жыл бұрын
Ultimate explanation..perfect coding pace..can you please create a playlist for Spring Core, Spring Mvc, Spring Boot..
@prathameshrane2047
@prathameshrane2047 8 жыл бұрын
Got It Clearly Now....
@jaydipbarvaliya
@jaydipbarvaliya 4 жыл бұрын
please come up with some diagram before handson! so learners easily grasp whatever you gonna do
@DeepakKumar-zk3dc
@DeepakKumar-zk3dc 2 жыл бұрын
class EqualsMethod { public static void main(String[] args) { String s = new String("Deepak"); String s2 = new String("Deepak"); System.out.println("Equals method "+s.equals(s2)); // true System.out.println(s == s2); // false } }
@sendacool88
@sendacool88 8 жыл бұрын
thank you for video . some time i saw number next hashcode like this one 97 * hash + Objects.hashCode(this.profileId); +
@B-Billy
@B-Billy 7 жыл бұрын
Yes, that number is should be a PRIME NUMBER. Its used to calculate hash code for customized object. The number is useful because the aim of calculating of hash code is to get unique hash code for each and every object and here this PRIME NUMBER helps a lot.
@DoomInSor
@DoomInSor 7 жыл бұрын
thank yoooooooo
@riteshsingh8813
@riteshsingh8813 5 жыл бұрын
Could have been better if you would have explained the hierarchy how they are called along with purpose. You kept on repeating this is helpful rather than you should explain how it works.
@bhanuchandar4419
@bhanuchandar4419 5 жыл бұрын
Sir u have to explain for every line why what and when u didn't follow please next time onwards try follow clear ur English nice but explanation need to clear
@kamalraj-so5xm
@kamalraj-so5xm 6 жыл бұрын
not clear explanation. not at all satisfied
@vijaychaudhari1404
@vijaychaudhari1404 5 жыл бұрын
not satisfy wrong explanation of equal method
@subhasisroy4462
@subhasisroy4462 4 жыл бұрын
Not at all clear with this video. Very theoratical
Set and HashSet in Java - Full Tutorial
20:43
Coding with John
Рет қаралды 242 М.
How Strong Is Tape?
00:24
Stokes Twins
Рет қаралды 96 МЛН
Quando eu quero Sushi (sem desperdiçar) 🍣
00:26
Los Wagners
Рет қаралды 15 МЛН
Tuna 🍣 ​⁠@patrickzeinali ​⁠@ChefRush
00:48
albert_cancook
Рет қаралды 148 МЛН
Array vs. ArrayList in Java Tutorial - What's The Difference?
17:36
Coding with John
Рет қаралды 574 М.
Generics In Java - Full Simple Tutorial
17:34
Coding with John
Рет қаралды 1,1 МЛН
Java Collections Explained (with examples)
10:39
Visual Computer Science
Рет қаралды 104 М.
9. Java Memory Management and Garbage Collection in Depth
48:48
Concept && Coding - by Shrayansh
Рет қаралды 115 М.
Difference Between "== Operator" And "equals() Method" In Java (Hindi)
15:02
Stream API in Java
26:04
Telusko
Рет қаралды 377 М.
How HashMap Works Internally?
20:58
Siva Reddy
Рет қаралды 72 М.
How Strong Is Tape?
00:24
Stokes Twins
Рет қаралды 96 МЛН