Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

why the equals method can be override?when we override the
equals method?

Answer Posted / madhu

equals() method will be available in primodian class that is
Object class, but by default it compares only the addresses,
not the contents, So if you want the content comparison you
have to override equals(), but if u override the equals(),
you have to override the hashCode() also.

Is This Answer Correct ?    3 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between compile-time polymorphism and runtime polymorphism?

1065


Can an interface be defined inside a class?

1108


What does || mean in code?

1103


Does printwriter create a file?

1016


What does file separator do in java?

1078


What is a classloader in java?

1067


What is difference in between java class and bean?

1166


How does the java compiler work?

1039


What is the purpose of main function in java?

1079


What is the difference between sleep and wait in java?

1019


What are 4 pillers of object orinted programming?

1076


What are the types of java languages?

1041


Which methods cannot be overridden in java?

1050


What is flag in python?

1082


Why can't you declare a class as protected?

1209