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

Can a method inside a interface be declared as final?

1042


What is a nested list?

1018


What is append function?

1055


Which eclipse is best for java?

1053


Explain the scope or life time of class variables or static variables?

1038


Can final class have constructor?

970


Why pointers are not used in java?

1177


What is map in java?

1047


What is an empty string in css?

1097


How hashset works internally in java?

1137


What is a key in java?

1019


Can a class extends itself in java?

1067


What is pojo class in java?

1196


What about interrupt() method of thread class ?

1119


Difference between ‘is-a’ and ‘has-a’ relationship in java?

1042