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

using equals method overriding which objects are
compared?i.e same class objects or other class
objects?Explain me.

Answer Posted / r.jainrocks@gmail.com

we compare with same class object...

let me know when u override equals() method
u code like--->

this.name.equals(obj.name);

so this comparison is with same class object not with
other class.....

if there is other class class object then
ClassCastException may occur due wrong casting...

so be careful while using equals method overriding....

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the SimpleTimeZone class?

2271


What is the differences between heap and stack memory in java? Explain

973


Can we have this () and super () together?

1041


Which container method is used to cause a container to be laid out and redisplayed in java programming?

1096


What are the two types of java programming?

1054


Difference between comparator and comparable in java?

1087


What is the purpose of void?

990


What is the purpose of the strictfp keyword?

1153


How to make a non daemon thread as daemon?

1056


What is square root in java?

1093


What are thread local variables?

1135


How does system arraycopy work in java?

1108


What does indexof return in java?

978


What is java literals?

1125


List implementations of list interface?

1031