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

What is difference between “==” and equals()?

Answer Posted / javamasque

“==”: It compares references (memory locations). It does not compares values in the memory location. Hence it is not recommended to find the equality of two objects. It is mostly used to compare primitive types.

equals(): It is used to find the equality of two objects. It actually compares with the values that an object contains.

Is This Answer Correct ?    5 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is derived datatype?

1147


Which package is always imported by default?

1036


Explain access modifiers in java.

968


Explain throw keyword in java?

991


Explain about transient variables in java?

1034


What is function and method in java?

904


How do I remove a character from a string in java?

918


Is an integer an object?

900


Does constructor return any value?

969


Is list thread safe in java?

872


Explain the difference between abstract class and interface in java?

930


What is number data type in java?

941


What are facelets templates?

978


I want my class to be developed in such a way that no other class (even derived class) can create its objects. Define how can I do so?

1115


Which are different kinds of source code?

1050