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 treemap in java?

1036


What is java autoboxing?

992


Explain the difference between jdk, jre, and jvm?

1081


What is the difference between choice and list?

1135


Why is java so important?

1157


Why is method overloading not possible by changing the return type in java?

1051


How many functional interfaces does java 8 have?

1074


what is session in java?

1313


How many techniques can be employed to create a string object?

1165


does java support pointers?

1045


What are default methods ?

1104


In the below example, how many string objects are created?

1092


List some java keywords sun like c, c + + keywords?

1059


Can we extend a class with private constructor?

1067


List out benefits of object oriented programming language?

941