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

preview_player
Показать описание
equals and hashCode methods implementation in the data objects is extremely important when the application creates and hold data obtained from the database or from any source. It is important that applications does not maintain the redundant information as part of the objects which eat the memory as well as impact the performance of collections and sometime even functioning of collections is directly dependent on these methods.
So, in this video i have explained the importance of overriding equals and hashcode methods and also demonstrated how they impact the performance of the collections.
Рекомендации по теме
Комментарии
Автор

శ్రీనివాస్ గారు, equals, hashCode మధ్య తేడాని బాగా వివరించారు. థ్యాంక్యూ !
Credit is where credit due.

mistery
Автор

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

Adam-gpij
Автор

s.equals(s2) method will return true, not false.

jyotipalapure
Автор

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

DeepakKumar-zkdc
Автор

it will return true when you compare these objects: Student s and Student s2 with equals, because they have the same object argument

DR-pivk
Автор

Very informative video. Please make a video on hashcode implementation and ovveriding also.

kumarshivam
Автор

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

dhiru
Автор

great video but why do you hit your keyboard so hard?

poornas
Автор

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

}
}

DeepakKumar-zkdc
Автор

What you said at 3.07 sec is false, it returns true

manideepreddygeetla
Автор

please come up with some diagram before handson! so learners easily grasp whatever you gonna do

jaydipbarvaliya
Автор

excellent explanation...

please make a video on how to authenticate rest web services using OAuth and OAuth 2.

dips
Автор

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 ?

MrJonnis
Автор

Simple and Lucid explanation. Respects!

naveenp
Автор

Ultimate explanation..perfect coding pace..can you please create a playlist for Spring Core, Spring Mvc, Spring Boot..

djanupamdas
Автор

thank you for video . some time i saw number next hashcode like this one 97 * hash + +

sendacool
Автор

Excellent explanation. Thank you, sir.

krayziesensei
Автор

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

bhanuchandar
Автор

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.

qwbecqbcQS
Автор

not clear explanation. not at all satisfied

kamalraj-soxm