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

How many ways can an argument be passed to a subroutine and explain them?

1028


How many return statement are allowed in a function?

934


How to find the given number is a prime number or not by getting input from the user

1098


What is class and object in java?

1005


What is a super method?

978


What is the difference between equals() and == in java?

972


Convert a BST into a DLL and DLL to BST in place.

1116


What is stringjoiner ?

956


Is .net better than java?

1014


What is an interoperable application in java ?

999


What is null data type?

1099


What are the Class Libraries ?

1045


Explain the protected field modifier?

1093


What is the full form of jpeg?

963


What are new features introduced with java 8 ?

991