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

Explain garbage collection in java?

981


What are basic data types?

1095


What is identifier give example?

1029


What is the Difference between Final Class && Abstract Class?

1077


What are thread local variables?

1151


What is generic type?

1029


What is a vararg?

1035


Can a class extends itself in java?

1025


which pattern is default in scanner package?

2235


What are the different conditional statements?

994


What the difference is between execute, execute Query, execute Update?

835


What is the use of conditional statement?

985


Explain when classnotfoundexception will be raised ?

1040


Does sprintf allocate memory?

1111


What happens if a try-catch-finally statement does not have a catch clause to handle an exception that is thrown within the body of the try statement?

1108